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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Socket.SendFile. 0
file transfer with sockets 10
newbie socket question 1
Socket receive question 5
C# file Transfer 3
file transfer help? 2
File Chunking 2
Send Anywhere or similar program ? 8

Back
Top