|
-
September 20th, 2004, 07:33 PM
#1
CSocket - incomplete data (again)
Hi
I have an odd situation I hope someone could point me in the right direction with. Basically I have a client tcp application that is CSocket (SOCK_STREAM) based, and there is a well defined protocol between the client and server.
Unfortunately there are instances where the data sent to the client application (viewed via a sniffer program) seem not to be completely received. The server may send data at certain intervals in response to a client request: when the client has had enough, it will issue a request to terminate the data where upon the server will issue a confirmation string.
For example, server sends
AB
AB
CDEF // termination confirmation
client reads AB, AB, and EF: expected AB, AB, and CDEF;
server sends
ABC
ABC
DEFGHI // termination confirmation
client reads ABC, ABC, and GHI: expected ABC, ABC, DEFGHI.
I am not sure if it is a coincidence that the number of characters chopped off in the final string happen to be the the number of characters read in the preceding string.
When I view return values from the socket reads, they look OK: in the second example above, the final read returns 3 for GHI, but I expected 6!
Has anyone seen anything similar? or can suggest any courses of action?
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
|