Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 21633 invoked from network); 31 Jan 2003 14:43:18 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 31 Jan 2003 14:43:18 -0000 Received: (qmail 25379 invoked by uid 97); 31 Jan 2003 14:44:44 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 25372 invoked from network); 31 Jan 2003 14:44:43 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 31 Jan 2003 14:44:43 -0000 Received: (qmail 21373 invoked by uid 500); 31 Jan 2003 14:43:15 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 21341 invoked from network); 31 Jan 2003 14:43:14 -0000 Received: from pasmtp.tele.dk (193.162.159.95) by daedalus.apache.org with SMTP; 31 Jan 2003 14:43:14 -0000 Received: from [192.168.1.50] (cpe.atm0-0-0-149293.0x503f9bba.bynxx5.customer.tele.dk [80.63.155.186]) by pasmtp.tele.dk (Postfix) with ESMTP id 9A89CE2AB for ; Fri, 31 Jan 2003 15:43:07 +0100 (CET) Mime-Version: 1.0 X-Sender: jnp@mail.anneli.dk Message-Id: In-Reply-To: <200301302006.h0UK6vnK021331@yoda.savarese.org> References: <200301302006.h0UK6vnK021331@yoda.savarese.org> Date: Fri, 31 Jan 2003 15:39:26 +0100 To: "Jakarta Commons Developers List" From: =?iso-8859-1?Q?J=F8rgen?= =?iso-8859-1?Q?_?= =?iso-8859-1?Q?N=F8rgaard?= Subject: Re: [net] TelnetClient on Solaris - timeout problem Content-Type: text/plain; charset="iso-8859-1" ; format="flowed" Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks for the reply. That sounds like a reasonable approach for the release. I will try creating a special factory sometime next week. >In message , >=?iso-8859-1?Q?J=F8rgen?= =? >iso-8859-1?Q?_?= =?iso-8859-1?Q?N=F8rgaard?= writes: >>On Solaris however all connections using commons-net timeout after >>around 4 mins. >> >>The only way I see to do something on Solaris is to use jdk1.4.x >>which has a more elaborate api for Sockets. The program "sock" >>illustrates this. > >Right, so what you're saying is that you want to shorten how long it >takes for a connect fail if a connection hasn't been established. >Yes, prior to the J2SE 1.4, there was no way to do this. With >J2SE 1.4 you can either use the connect(SocketAddress, int timeout) >method the way you did in sock.java or use the java.nio package to >do a non-blocking connect and use select to implement a timeout, the >way you would in POSIX/C. For your purposes, you have a couple of >options. However, the easiest thing to do, which will require you >to make absolutely no changes to the commons-net source code, is >to subclass DefaultSocketFactory and reimplement the createSocket() >methods so that they create an unconnected socket and then use >Socket.connect(SocketAddress, int timeout) to establish a connection. You >can add a timeout to be used by the SocketFactory (setter and getter >and constructor argument) when creating a connected socket. Then just >create an instance of the SocketFactory and use >SocketClient.setSocketFactory(SocketFactory) to set the factory used >by your TelnetClient instance. > >For our purposes, we have to put out a first formal release before making >changes of this sort. For one thing, we have to agree on a backward >compatibility strategy. My suggestion is that the first release be made, >which given the current code should be compatible with JDK 1.1 through 1.3. >After this, I suggest we abandon compatibility with prior versions of Java >and leverage J2SE 1.4 features as appropriate. For example, there is no >reason for the telnet stuff to use threads now that we have non-blocking I/O. >Changing from a thread-based implementation to a select-based loop will >eliminate problems on some platforms, use less resources, be more efficient, >etc. Also, J2SE 1.4 finally added SocketFactory and ServerSocketFactory >classes in javax.net, possibly eliminating the need for >org.apache.commons.net.SocketFactory. The javax.net classes are almost >identical to ours and I wonder if the creators of javax.net read an article >I wrote years ago enumerating many of the flaws in java.net or they just >finally realized what should have been obvious to anyone. Anyway, >ours has the advantage of being an interface, but the disadvantage of >not being refactored into two interfaces. I'm hijacking the >thread, so I'll delay further discussion until after our first release. > >daniel > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org >For additional commands, e-mail: commons-dev-help@jakarta.apache.org -- /j�rgen n�rgaard ... For privacy ... e-mail: jnp@anneli.dk | Phone: +45 2627 3769 http://anneli.dk/~jnp/ ... PGP! ... |\ _,,,---,,_ /,`.-'`' -. ;-;;,_ |,4- ) )-,_. ,\ ( `'-' '---''(_/--' `-'\_) --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org