Article View: borland.public.cppbuilder.internet.socket
Article #1681Re: TCP TServer- and TClientSocket
From: Kresten Tolstrup
Date: Fri, 17 Nov 2006 19:57
Date: Fri, 17 Nov 2006 19:57
41 lines
2204 bytes
2204 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Kresten Tolstrup" <kt@danphone.com> wrote in message
>news:455d6ba5$1@newsgroups.borland.com...
>
>> I'm using the SendText and ReceiveText metodes
>
>I strongly discourage the use of those methods. You should use SendBuf()
>and ReceiveBuf() directly instead.
>
>> if I sent e.g 200 packets, as fast as possible, then they are not all
>received
>
>Yes, they are, as TCP guarantees packet delivery. You likely are simply not
>reading the packets properly in the first place. Please show your actual
>code. Are you taking into account that packets may be split and/or merged
>together? I guess would be no.
>
>> I have to put in a large delay about 100-150msec between each transmission
>
>All the more reason to suspect that your reading/writing code is not correct
>enough.
>
>
>Gambit
>
>
Hello again
Here is the code, it is in the ClientSocketRead metode. The received message is stored in the queue conStoredRxMsg. When the message is sent the SendText is just called.
string strMail = Socket->ReceiveText().c_str();
if (strMail.size() > 0)
{
m_pRxMsgSynchronizer->BeginWrite();
conStoredRxMsg.push(strMail);
m_pRxMsgSynchronizer->EndWrite();
}
Best Regards
Kresten Tolstrup
Technical Details
Message-ID:
<455e2228$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<455d6ba5$1@newsgroups.borland.com> <455d71f5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a552fcaaf39b63f9 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Kresten Tolstrup" <kt@danphone.com> Sender: "Kresten Tolstrup" <kt@danphone.com> Reply-To: "Kresten Tolstrup" <kt@danphone.com> Subject: Re: TCP TServer- and TClientSocket Newsgroups: borland.public.cppbuilder.internet.socket X-User-Info: 80.162.206.172 References: <455d6ba5$1@newsgroups.borland.com> <455d71f5$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <455e2228$1@newsgroups.borland.com> Date: 17 Nov 2006 12:57:12 -0700 X-Trace: newsgroups.borland.com 1163797032 207.105.83.66 (17 Nov 2006 12:57:12 -0700) Lines: 42 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail