|
-
June 10th, 2010, 08:09 AM
#1
[RESOLVED] Winsock send() question
i am working on a send/recieve file application... im sending the file piece by piece (7000 bytes every time) using Asynchronous Sockets through a loop
my problem is this:
some times , arbitrary , the server will not recieve the whole package the client sends(the 7000 bytes) but it will recieve it in 2 chunks ( ex. first 1500 bytes then 5500 bytes).
is this a winsock problem or a bug in my code?
i can provide any specific code if it helps
thanks
-
June 10th, 2010, 10:01 AM
#2
Re: Winsock send() question
it is not a winsock problem, it is how socket was designed to work.
If the sender sends 7000 bytes then the receiver may receive is in one packet of 7000 bytes and may receive 7000 packets of 1 byte and may receive any other number of packets (between 1 and 7000).
Victor Nijegorodov
-
June 10th, 2010, 02:43 PM
#3
Re: Winsock send() question
ah ok i understand that now....
another question i have releated to this:
lets say my client sends Simultaneously 2 files (2 threads sending) to the server
the client calls the send() function with a package of 7000 bytes
my question is, if the server recieves the packages in multiple chunks and not as one , will the recv() get the pieces of the same package in an order or they could be messed with the other send() thread packages?
-
June 10th, 2010, 03:12 PM
#4
Re: Winsock send() question
Victor Nijegorodov
-
June 10th, 2010, 03:13 PM
#5
Re: Winsock send() question
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|