🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Detecting that a socket was closed

#2518
From: Thomas Cheah
Date: Wed, 04 Oct 2000 00:00
63 lines
2851 bytes
This is a multi-part message in MIME format.
--------------5696DF29AB0FFEF013B5136E
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

The read() methods of Socket will return -1. If the other side didn't
close the connection, and there is not data, it won't return -1 but will
block until the data arrives.

Good luck!

Regards,
Thomas.

--
|��`�.��.���`�.��.���`�.��.���`�.��.����|
| Mr. Thomas Cheah.C.S.                 |
| University of Multimedia, Malaysia.   |
|��`�.��.���`�.��.���`�.��.���`�.��.����|
| mailto:thomascheah@hotmail.com        |
| Web site: http://surf.to/thomascheah  |
|           (HUGE books links!          |
|            FREE softwares!)           |
| Cell Phone: (+6012) 458 4116          |
 ��`�.��.���`�.��.���`�.��.���`�.��.����

Eduardo Bastos Leite wrote:

> How can I discover that a socket was closed by the other side of the
> connection before I do any read/write operation????
>
> Thanks in advance,
>
> Eduardo Bastos Leite
> eleite@nce.ufrj.br

--------------5696DF29AB0FFEF013B5136E
Content-Type: text/x-vcard; charset=us-ascii;
 name="thomascheah.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Thomas Cheah
Content-Disposition: attachment;
 filename="thomascheah.vcf"

begin:vcard 
n:Cheah;Thomas
tel;pager:N/A
tel;cell:(+6012) 458 4116
tel;fax:N/A
tel;home:N/A
tel;work:N/A
x-mozilla-html:FALSE
url:http://surf.to/thomascheah
org:University of Multimedia, Malaysia;Information Technology (Software Engineering)
adr:;;Jalan Multimedia;Cyberjaya;Selangor Darul Ehsan;63100;Malaysia
version:2.1
email;internet:thomascheah@hotmail.com
title:student
note;quoted-printable:I like computer programming. I have endured in=0D=0Acomputer programming since 1993. I am currently =0D=0Adeveloping Windows application mainly database system, =0D=0Amultimedia application, and games. =0D=0A=0D=0AI am also working with networking application using Java as =0D=0Amy primary language.=0D=0A=0D=0AI like music too. I usually play guitar.
fn:Thomas Cheah
end:vcard

--------------5696DF29AB0FFEF013B5136E--
Technical Details
Message-ID: <39DB09B6.D8794A73@hotmail.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39d9cfd1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,d887ff5bfecc6b41
X-Google-Attributes: gid1089d0,public
From: Thomas Cheah <thomascheah@hotmail.com>
Subject: Re: Detecting that a socket was closed
Date: 2000/10/04
Message-ID: <39DB09B6.D8794A73@hotmail.com>
X-Deja-AN: 677401450
References: <39d9cfd1_1@dnews>
X-Accept-Language: en
Content-Type: multipart/mixed; boundary="------------5696DF29AB0FFEF013B5136E"
Organization: University of Multimedia, Malaysia
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api