Archived

This topic is now archived and is closed to further replies.

File transfers

This topic is 5652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m sending packets over tcp, and the server is sending faster than the client can download, is this going to create a problem for the server? The only thing I can think of is creating a ''handshake'' to acknowledge my packet was received, and send that confirmation to the server for it to send the next chunk. Or maybe there is another way to do this? I''m thinking if my server continues pumping out data a lot of it will be lost. Please correct me if I made mistakes Thank you -Pipe

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
TCP does it''s own speed throttling. It will send a certain amount of data, and then won''t send anymore until the other end of the connection acknowledges that at least some has been received. So you shouldn''t have to worry about it.

Share this post


Link to post
Share on other sites
If your really stuck on using UDP if thats what your using. Do a search on the the internet for Windowing. We had to write our own in a computer science class i had taken. Loads of fun! not. Other wise TCP has its own built in windowing procedure that will only send X many packets until it hears from the receiver that it had received some.

***EDIT*** Oh sorry i just skimmed your post you are using TCP it should be taken care of for you

[edited by - GimpMaster on June 26, 2002 11:00:56 AM]

Share this post


Link to post
Share on other sites
Thank you for the fast replies, I have a follow up question.

What I want to do is run a loop that sends out packets (around 8k or so) of the file being transferred. What you folks are telling me is that no packets will be dropped, and the server will not see buffering problems?

What I am envisioning right now (I haven''t coded this function yet), is that if the client doesn''t receive fast enough, the server send buffer may be overwritten and packets will be lost.

Again please correct me if I''m wrong.
Thank you
-Pipe

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The server send buffer won''t be overwritten, you just won''t be able to add any new data to the send buffer until whats there gets sent. If you take a look at the send() function you''ll see that it''s return value is the number of bytes sent (aka added to the OS''s send buffer). You should always check this value.

Share this post


Link to post
Share on other sites