Login  
Search All Forums
Dart Home | PowerTCP Sockets for .NET | Custom Development Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
AuthorForum: PowerTCP Sockets for .NET (Secure and Standard)
Topic: Client Server file copy
david@vinwizard.com

From: Renwick, New Zealand
Posts: 1
Member Since: 10/26/09
posted October 26, 2009 6:41 AM

Hi I am playing with the OTP example. What I need to do is for the client to initiate a file copy. The server creates an xml file and the client needs to copy it to the local computer to be opened by another application. To get around firewalls I need to be able to initiate the copy from the client and return the file on the same port. Does anyone have an example or an idea how I might do this. Thanks.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted October 26, 2009 9:57 AM

Hi,
You have to have a protocol that the client and server follow.
Here is a simple, no-frills example:

The client connects to the server and sends a filename, followed by a terminating character or sequence.
It posts a Receive, waiting for the file's data.

The server receives the filename and opens the file with a FileStream.
Data is sent to the client as it is read.
When finished, the server closes the connection.

The client writes the data to a FileStream as it receives it.
When the connection closes, it closes the FileStream.

Hope it helps,
-ken

------
-Non-current subscribers must contact sales@dart.com to update subscription and receive continued support as needed.
------

Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX