🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #663

Re: ServerSocket and Threads

#663
From: Remy Lebeau (TeamB)
Date: Tue, 18 Dec 2007 19:04
19 lines
1856 bytes
"Pere Mateu" <pmateu@siam.es> wrote in message 
news:4767f62c@newsgroups.borland.com...

> when I close the server, the client socket believes it's active
> (Active property still set is TRUE).

As it should be.  That is not what the Active property is for.  You should 
be looking at the Socket.Connected property instead.

> How can I detect in the client socket that the server has been shut down?

If you are using the client in non-blocking mode, then you will get an 
OnDisconnect event.  If you are using it in blocking mode instead, then 
SendBuf() and ReceiveBuf() will return 0 the next time you write to, or read 
from, the connection.


Gambit 
Technical Details
Message-ID: <47681a07$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <op.tyjavhtkwzezly@dune.intranet> <46e81ec5$3@newsgroups.borland.com> <op.tyk0galowzezly@dune.intranet> <46e8ed65@newsgroups.borland.com> <op.tyk3fng6wzezly@dune.intranet> <4767f62c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f2f18bf54164452d
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <op.tyjavhtkwzezly@dune.intranet> <46e81ec5$3@newsgroups.borland.com> <op.tyk0galowzezly@dune.intranet> <46e8ed65@newsgroups.borland.com> <op.tyk3fng6wzezly@dune.intranet> <4767f62c@newsgroups.borland.com>
Subject: Re: ServerSocket and Threads
Date: Tue, 18 Dec 2007 11:04:08 -0800
Lines: 21
Organization: Lebeau Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 207.178.157.90
Message-ID: <47681a07$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1198004743 207.178.157.90 (18 Dec 2007 11:05:43 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail