Article View: borland.public.cppbuilder.internet.socket
Article #3988Re: bcb ServerSocket
From: Joel Guerra
Date: Wed, 20 Apr 2005 19:00
Date: Wed, 20 Apr 2005 19:00
43 lines
2881 bytes
2881 bytes
I understand, so I have built in a timer to ping-pong back and forth, if I am missing a pong from the client, I assume the client has disconnected for some reason, and want to clobber the connection, so that the next time the client connects, he connects to connection[0] instead of [1]... Thanks, Joel "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:4266a2c5@newsgroups.borland.com... > > "Joel Guerra" <j.nospamguerra@texasscenic.com> wrote in message > news:42665b58@newsgroups.borland.com... > > > Thanks, this works most of the time, but I still have a > > problems every now and again if I pull the enet cable out. > > Under most versions of Windows, the socket stack cannot detect that to begin > with, so sockets have no way of knowing that they are actually gone. This > is actually by design. Temporary outages on a LAN/WAN are common. Socket > stacks are designed to handle that situation internally by keeping sockets > "alive" for an period of time. If the network comes back in a timely > fashion, the socket stack can reestablish communication with the remote > machine silently and gracefully, and the application will never know that > the connection was ever down. If the network does not come back, or if the > remote machine cannot be reached anymore, then the stack still has no way of > knowing that the socket connection is really gone until the socket times out > internally. Only then can the socket be invalidated by the socket stack. > Until that happens, the socket stack does not report any errors on the > socket, so the application has no way of knowing what.is happening. > > > Gambit > > >
Technical Details
Message-ID:
<4266a6d6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42657f98$1@newsgroups.borland.com> <4265cd92$1@newsgroups.borland.com> <42665b58@newsgroups.borland.com> <4266a2c5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,8f3aebf0a06ba50 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Joel Guerra" <j.guerra@texasscenic.com> From: "Joel Guerra" <j.guerra@texasscenic.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <42657f98$1@newsgroups.borland.com> <4265cd92$1@newsgroups.borland.com> <42665b58@newsgroups.borland.com> <4266a2c5@newsgroups.borland.com> Subject: Re: bcb ServerSocket Date: Wed, 20 Apr 2005 14:00:24 -0500 Lines: 45 Organization: Texas Scenic Company X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 66.118.7.42 Message-ID: <4266a6d6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114023638 66.118.7.42 (20 Apr 2005 12:00:38 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!diablo.voicenet.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail