socket.sendfile question (or general file transfer)

  • Thread starter Thread starter djc
  • Start date Start date
D

djc

the system.net.sockets.socket class has the 'sendfile' method. What do you
do on the other end to 'receive' the file? I know the regular socket.receive
will receive the data into a buffer (a byte array) but if that is how you
are supposed to receive the file how do you make it 'the file' again? Lets
say I send over a text file, or a binary file, or whatever, how does it get
back to its original format? Or am I way off base to begin with? should I be
using something else to send files in a client server or peer to peer type
setup?

any input on this would be greatly appreciated. Thanks.
 
IIRC SendFile after transferring file will close the connection. Also you
can specify prefix and suffix data for the file. This tokens can be detected
on the remote host.

In the prefix data you can specify file name and file size so that remote
host could save the file.

Another way is to define your custom protocol where you will specify file
name and send file using common Send
 
Back
Top