From owner-freebsd-java Fri Aug 31 2:42:35 2001 Delivered-To: freebsd-java@freebsd.org Received: from gnuppy.monkey.org (cx739861-a.dt1.sdca.home.com [24.5.164.61]) by hub.freebsd.org (Postfix) with ESMTP id 4AF6937B401 for ; Fri, 31 Aug 2001 02:42:32 -0700 (PDT) (envelope-from billh@gnuppy.monkey.org) Received: from billh by gnuppy.monkey.org with local (Exim 3.32 #1 (Debian)) id 15ckkm-0005SM-00; Fri, 31 Aug 2001 02:38:20 -0700 Date: Fri, 31 Aug 2001 02:38:20 -0700 To: Mikhail Kruk Cc: java@freebsd.org, glewis@eyesbeyond.com, Bill Huey Subject: Re: jdk1.3.1 socket problem Message-ID: <20010831023820.A20158@gnuppy> References: <55lmk5czi0.wl@tripper.private> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.20i From: Bill Huey Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Aug 27, 2001 at 11:29:16AM -0400, Mikhail Kruk wrote: > OK, my first bug report sucked, it wasn't really jdk's problem and > workaround is trivial. > But I'll try again. Please let me know if it is not yet time for bug > reports and I'll shut up :) > > When I try to run the following code sample I get: > java.net.SocketException: errno: 56, error: Socket is already connected > for fd: 4 > > import java.net.*; > > public class test > { > public static void main(String[] args) > { > try > { > Socket socket = new Socket( "www.cs.brandeis.edu", 80); > socket.close(); > } > catch(Exception e) > { > System.err.println(e); > } > } > } Check this out: [billh@finfin]$ ../../../bin/appletviewer example1.html _X11TransOpenCOTSClient(tcp/gnuppy:0) _X11TransOpen(1,tcp/gnuppy:0) _X11TransParseAddress(tcp/gnuppy:0) _X11TransSelectTransport(tcp) _X11TransSocketOpenCOTSClient(tcp,gnuppy,0) _X11TransSocketSelectFamily(tcp) _X11TransSocketOpen(1,1) _X11TransConnect(5,tcp/gnuppy:0) _X11TransParseAddress(tcp/gnuppy:0) _X11TransSocketINETConnect(5,gnuppy,0) _X11TransSocketINETConnect: inet_addr(gnuppy) = ffffffff _X11TransSocketINETConnect: sockname.sin_port = 6000 _X11TransSocketINETConnect: Can't connect: errno = 56 _X11TransClose(5) _X11TransSocketINETClose(81ad580,5) It's the debug log from XOpenDisplay and it's attempt at doing a connect(). /usr/include/sys/errno.h:#define EISCONN 56 /* Socket is already connected */ The problem with X remote display and connect() in that example are definitely related. IP address value of 0xffffffff ? what hell ? What do you think Greg ? This could be a race of some sort. More investigation needed. ;-) bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message