Article View: borland.public.cppbuilder.internet.socket
Article #2399Re: TServerSocket SendText Exception
From: Eric Patterson
Date: Mon, 24 Apr 2006 13:20
Date: Mon, 24 Apr 2006 13:20
40 lines
3051 bytes
3051 bytes
Do you think that the Invalid Pointer Exception is coming from the client
not being present? The system I have setup should always have a client
present; I typically (and my test rig is setup this way) only have two
client's connected to the server application. They both get the same
messages no matter what and they should never leave (or disconnect from the
server). I can go through and make the server app more robust with the last
suggestions but I know that I am getting an invalid pointer exception
dealing with a SendText and the client didn't disconnect. Also you stated
earlier that I can't keep doing a sendtext until I get a ClientWrite Event
after a -1 was returned from a SendText. Now you are saying I have to do a
SendText (pump the message queue) so I know the state of the socket. I am
sure I just don't understand what you said below because that doesn't make
sense. Thanks for the learning experience thus far.
Eric
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:444934c4$1@newsgroups.borland.com...
>
> "Eric Patterson" <eric.patterson@bepco.com> wrote in message
> news:44491a72$1@newsgroups.borland.com...
>
>> Server->WaitForClientWriteEvent = true;
>> while( Server->WaitForClientWriteEvent )
>> {
>> Sleep(10);
>> }
>
> That will not work. Non-blocking sockets use window messages internally.
> You must pump the message queue in order for those events to occur. Which
> then complicates your code because now clients can connect/disconnect
> while
> you are still looping through them, so your loop can become screwed up
> because your code is currently not set up to handle that situation.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<444cd08c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.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> <44491a72$1@newsgroups.borland.com> <444934c4$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> <44491a72$1@newsgroups.borland.com> <444934c4$1@newsgroups.borland.com> Subject: Re: TServerSocket SendText Exception Date: Mon, 24 Apr 2006 09:20:13 -0400 Lines: 42 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: <444cd08c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1145884812 70.225.107.130 (24 Apr 2006 06:20:12 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.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