Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
windows sockets: sent 2 packets, receive 1
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
GilNajera  
View profile  
 More options Jan 14 2011, 10:29 am
Newsgroups: comp.client-server
From: GilNajera <gilnaj...@gmail.com>
Date: Fri, 14 Jan 2011 07:29:45 -0800 (PST)
Local: Fri, Jan 14 2011 10:29 am
Subject: windows sockets: sent 2 packets, receive 1
Hi everyone!

I have an application that communicates 2 computers using tcp sockets
(winsocks). The most of the time it works fine, but some packets are
received as 1 when they was sent as 2 or 3. I mean, I execute two or
three send commands and receive all the data in one single packet.

The packets are sent every 200 ms (Naggle algorithm is disabled) and
there is an independent thread receiving on the other side's
application. When a packet is received it is processed immediately,
after that, the receiving is resumed.

I'm not an expert in networking, can anybody tell me why is this
happening, and how can I solve it.

Thanks in advance.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
GilNajera  
View profile  
 More options Jan 14 2011, 4:15 pm
Newsgroups: comp.client-server
From: GilNajera <gilnaj...@gmail.com>
Date: Fri, 14 Jan 2011 13:15:26 -0800 (PST)
Local: Fri, Jan 14 2011 4:15 pm
Subject: Re: windows sockets: sent 2 packets, receive 1
Solved!

I understand now, I need to add some separation algorithm for all data
I receive. I will add size information to each send and re-form the
packets when data is received.

TCP has a constant flow of data, not a packet structure.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
GilNajera  
View profile  
 More options Jan 17 2011, 3:50 pm
Newsgroups: comp.client-server
From: GilNajera <gilnaj...@gmail.com>
Date: Mon, 17 Jan 2011 12:50:29 -0800 (PST)
Local: Mon, Jan 17 2011 3:50 pm
Subject: Re: windows sockets: sent 2 packets, receive 1
Solved!

The first 2 characters in every 'send' are the size of data.

If received size is greater than expected size, I make a loop to
process each received block. If the las block is incomplete, another
recv is done and when that block is complete, it is processed.

Thank you all!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »