🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2583

Re: How to tell if a Socket has closed?

#2583
From: Andrea König
Date: Tue, 19 Sep 2000 00:00
20 lines
1411 bytes
Why don't you send a message to the server? I do this in this way that I send
the string "quit" to the server befor closing the socket connection by the
client. Receiving this string the server closes the connection, too. Could this
help you?

Gkingsley wrote:

> Hello All,
>
> I have a server application that opens a ServerSocket and then accepts
> Socket connections from clients. How can I tell if the client has reset the
> connection? I come from the Delphi world where I would just get an event
> fired at me, but the Java API does not appear to be set up this way.
>
> We are currently using a time out, but it is important to close the Socket
> as quickly as possible because this application only allows one client
> connection at a time. Can anyone help me?
>
> Regards,
> Gavin Kingsley.
Technical Details
Message-ID: <39C7173E.64A2BF61@isikgmbh.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8prdna$r7g7@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,98b7dc786d67794b
X-Google-Attributes: gid1089d0,public
From: Andrea König <Andrea.Koenig@isikgmbh.de>
Subject: Re: How to tell if a Socket has closed?
Date: 2000/09/19
Message-ID: <39C7173E.64A2BF61@isikgmbh.de>
X-Deja-AN: 671515087
Content-Transfer-Encoding: 7bit
References: <8prdna$r7g7@bornews.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 19 Sep 2000 00:26:19 -0800, 62.155.201.186
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api