Article View: borland.public.cppbuilder.internet.socket
Article #3186Re: packet contatenation
From: Joe Black
Date: Tue, 25 Oct 2005 17:45
Date: Tue, 25 Oct 2005 17:45
54 lines
2763 bytes
2763 bytes
Hans Galema wrote: > Joe Black wrote: > >> .... The problem seems to be when I send several packets straight >> after each other, the packets are all sent within a thread that >> activates every 35 ms and it sends one packet at a time. > > > But what is the problem ? Several packets get concatenated together. > >> For some reason though several packets seem to get concatenated >> together to form one larger packet, if I slow down the transmit thread >> to say every 200ms this problems dissapears, > > > Yes that is normal. Winsock will send it's buffer when it is full or > a certain amount of time has elapsed. This is what I was wondering, I was hoping I could send data when it was empty. > >> this sort of time delay however is unacceptable. What I would like to >> know is: >> >> Is there anyway to determine whether the last packet was sent before I >> attempt to send the next one > > > Don't think so. But why would you? You have to program the receiving > side in such a way that it can handle multiple 'packets' in one read event. > Just as the receiving side should concatenate read-events until > a complete (big) message is received. I have a fairly simple app and I was hoping to make it easier, if this is the way to do it then I will code it to as you suggest. > > FYI: it is confusing that you use the word packet for the message > that you send. TCP/IP uses packets already. Appologies, the data I send is in a packet format, hence i use the term packet. I am fairly new to the Sockets side of things so my terminology may be confusing. > > Hans. Many thanks, you seem to have answered everything I needed to know Joe
Technical Details
Message-ID:
<435e6dd3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<435e5931$1@newsgroups.borland.com> <435e5d95$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,de4e39df019561af X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 25 Oct 2005 18:45:43 +0100 From: Joe Black <nospam@newsgroup.com> User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: packet contatenation References: <435e5931$1@newsgroups.borland.com> <435e5d95$1@newsgroups.borland.com> In-Reply-To: <435e5d95$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.177.44.177 Message-ID: <435e6dd3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1130261971 80.177.44.177 (25 Oct 2005 10:39:31 -0700) Lines: 54 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail