Article View: borland.public.cppbuilder.internet.socket
Article #4405Re: Socket Error # 10040 Message To Long
From: Jonathan Benedicto
Date: Tue, 22 Feb 2005 20:59
Date: Tue, 22 Feb 2005 20:59
21 lines
1780 bytes
1780 bytes
> No. The datagram itself is too large for the socket to buffer > internally > before your own code then reads it from the buffer. Once in the > buffer, it > doesn't matter how your code reads it. But the socket has to > receive and > buffer it first, and that is where the error is coming from. When I changed the code to read 8192 bytes into a memory stream, then the error disappeared. I did tests on it, and it did seem like the error was caused by the tiny read. For example, this code does not give a error : TMemoryStream* s = new TMemoryStream(); s->SetSize(8192); int size = UdpClient->ReceiveBuffer(s->Memory, s->Size, 1000); But this code returns a message too long error : int size = UdpClient->ReceiveBuffer(buffer, 4, 1000);
Technical Details
Message-ID:
<421b9d23@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42179afe@newsgroups.borland.com> <4217d04f$1@newsgroups.borland.com> <4217d1de@newsgroups.borland.com> <421b7e58$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,1c3545c190705d18 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jonathan Benedicto" <incorrect@no.server> Newsgroups: borland.public.cppbuilder.internet.socket References: <42179afe@newsgroups.borland.com> <4217d04f$1@newsgroups.borland.com> <4217d1de@newsgroups.borland.com> <421b7e58$1@newsgroups.borland.com> Subject: Re: Socket Error # 10040 Message To Long Date: Tue, 22 Feb 2005 15:59:18 -0500 Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 69.158.116.187 Message-ID: <421b9d23@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109105955 69.158.116.187 (22 Feb 2005 12:59:15 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail