Article View: borland.public.cppbuilder.internet.socket
Article #2395Re: TServerSocket SendText Exception
From: Eric Patterson
Date: Fri, 21 Apr 2006 17:46
Date: Fri, 21 Apr 2006 17:46
61 lines
2799 bytes
2799 bytes
I just don't get this stuff. I am still getting an invalid pointer
exception. Here is the current snippet:
for(ii=0;ii<Server->ServerSocket1->Socket->ActiveConnections;ii++)
{
TCustomWinSocket *Socket =
Server->ServerSocket1->Socket->Connections[ii];
AnsiString temp = AMsg + "\n";
int sent, len = temp.Length();
char *ptr = temp.c_str();
while( len > 0 )
{
sent = Socket->SendBuf(ptr, len);
if( sent > 0 )
{
ptr += sent;
len -= sent;
continue;
}
if( (sent == -1) && (WSAGetLastError() == WSAEWOULDBLOCK) )
{
Server->WaitForClientWriteEvent = true;
while( Server->WaitForClientWriteEvent )
{
Sleep(10);
}
continue;
}
break;
}
}
You can see I added in the part to wait until a ClientWriteEvent occured
when a WSAEWOULDBLOCK occurs.
Eric
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:44480aa5$1@newsgroups.borland.com...
>
> "Eric Patterson" <eric.patterson@bepco.com> wrote in message
> news:4447c0b0$1@newsgroups.borland.com...
>
>> That is all fine but why?
>
> I already gave you a detailed explanation about that. Please go re-read
> my
> earlier reply more closely.
>
>> I would love to fix my issue
>
> Then please try the code I already gave you.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<44491a72$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.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:
<44439c71$1@newsgroups.borland.com> <4443ca2a$1@newsgroups.borland.com> <4447a6f6$1@newsgroups.borland.com> <4447b917$3@newsgroups.borland.com> <4447c0b0$1@newsgroups.borland.com> <44480aa5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,fea0b13af0f4efa8 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Eric Patterson" <eric.patterson@bepco.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <44439c71$1@newsgroups.borland.com> <4443ca2a$1@newsgroups.borland.com> <4447a6f6$1@newsgroups.borland.com> <4447b917$3@newsgroups.borland.com> <4447c0b0$1@newsgroups.borland.com> <44480aa5$1@newsgroups.borland.com> Subject: Re: TServerSocket SendText Exception Date: Fri, 21 Apr 2006 13:46:26 -0400 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 70.225.107.130 Message-ID: <44491a72$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1145641586 70.225.107.130 (21 Apr 2006 10:46:26 -0700) Path: arc1-ca.pugleaf.net!g2news2.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