File transfer using TCPClient with a client/server [VB.NET 2005 Express]
I have a client and server app, which are able to connect to one another and exchange binary data. I'm using the TCPClient which only seems to be able to transmit in 8KB (8192 byte) chunks of data. Even if I set the send and receive buffers to say 20KB it will still max out at 8KB.
I'm trying to transmit 5MB peices of data from the server to the client. I'm having a hard time trying to figure out how to send the 5MB of data in 8KB chunks from server to client. The hardest time I'm having is receiving the first 8KB peice and then co-ordinating the server and client app so the server does not try to send another chunk while the client is still processing it.
Will the TCPClient dump a whole bunch of 8KB chunks into the network stream or will it send the first 8KB chunk, wait for the receiving TCPClient to acknowledge it was received and continue on?
Would I have to send an 8KB chunk to the client, have the client send back a message saying it was receieved and then have the server transmit again? That seems like an awful lot of overhead.
Re: File transfer using TCPClient with a client/server [VB.NET 2005 Express]
I would go with the method where it sends the chunk of data, then the host sends a command back saying its ready for the next piece.
there is a tutorial here about coding file transfers, I know your not using winsock or vb6 but you get the idea of how to do it www.winsockvb.com
also ive seen a few binary transfer apps on www.pscode.com so you could take a look at them to see how they do it