Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 89433 invoked from network); 29 Jul 2003 13:45:51 -0000 Received: from kitchen.mylittleisp.net (HELO fridge.mylittleisp.net) (62.49.203.74) by daedalus.apache.org with SMTP; 29 Jul 2003 13:45:51 -0000 Received: from [192.168.0.40] (bedroom.mdsh.local [192.168.0.40]) by fridge.mylittleisp.net (8.12.8/8.12.8) with ESMTP id h6TDjpWs017051 for ; Tue, 29 Jul 2003 13:45:51 GMT Date: Tue, 29 Jul 2003 14:45:52 +0100 From: Mark Himsley To: Jakarta Commons Users List Subject: Re: commons/net whois fails with whois.opensrs.net Message-ID: <24803812.1059489952@[192.168.0.40]> In-Reply-To: <200307290206.h6T26n0l004083@gandalf.savarese.org> References: <200307290206.h6T26n0l004083@gandalf.savarese.org> X-Mailer: Mulberry/3.0.3 (Win32) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="==========24820651==========" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --==========24820651========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline --On 28 July 2003 22:06 -0400 "Daniel F. Savarese" wrote: > In message <10804015.1059400334@[192.168.0.40]>, Mark Himsley writes: > > My basic question is: how do I stop commons/net from setting the TCP > > push flag on the socket connection. > > > > I've looked through the source of WhoisClient, FingerClient, > > SocketClient, SocketFactory, DefaultSocketFactory and as yet don't > > have a clue why the push flag is set ant the query is fragmented. > > I'm going to have to punt this to someone else (maybe you if you've > got the interest/time) to fix and patch, but if the push flag is being > set, it's being done automatically by the JVM's class library in native > code. There's probably a call to OutputStream.flush() somewhere and > the underlying native code is turning that into TCP push. Why that's > happening in the middle of as small amount of data as occurs in a > whois query, I don't know. Yes, that is a good question. I am wondering if there is a bug somewhere which is forcing a flush() after the first byte of a DataOutputStream.writeBytes() call. I shall have to test this hypotheses at some stage (unless someone else can confirm/deny this problem) and also test with JVM 1.4.1_02. What I have done to correct this problem is to apply the attached patch to (admittedly to the NET_1_0_0 tagged version of) commons/net. I'm not completely sure what the implications are for converting a DataOutputStream.writeBtyes(String) into a PrintStream.print(String), which is essentially what I have done. I can't immediately see a problem though. Looking with snort at the data sent from the fwhois example commons/net source with this patch applied I can see that the request is sent in one packet - still with the push flag set, but I guess that's because of the output.flush() call in FingerClient.getInputStream(). =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 07/29-13:17:47.838544 62.49.203.77:1591 -> 216.40.33.170:43 TCP TTL:127 TOS:0x0 ID:11642 IpLen:20 DgmLen:50 DF ***AP*** Seq: 0xC9BCBD8C Ack: 0xDE3FD9B2 Win: 0xFAF0 TcpLen: 20 6D 64 73 68 2E 63 6F 6D 0D 0A mdsh.com.. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Thanks for your time. > daniel -- Mark Himsley --==========24820651==========--