Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 45F92D86B for ; Mon, 4 Feb 2013 04:51:46 +0000 (UTC) Received: (qmail 13595 invoked by uid 500); 4 Feb 2013 04:51:42 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 13429 invoked by uid 500); 4 Feb 2013 04:51:42 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 13391 invoked by uid 99); 4 Feb 2013 04:51:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 04:51:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stewart.vince@gmail.com designates 209.85.216.45 as permitted sender) Received: from [209.85.216.45] (HELO mail-qa0-f45.google.com) (209.85.216.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 04:51:36 +0000 Received: by mail-qa0-f45.google.com with SMTP id g10so1097064qah.11 for ; Sun, 03 Feb 2013 20:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=N3osYAZCztFozKtoWm4EjBqIN7jGXCAgu9CXBDoxp2s=; b=jq2AkUkwbO44WfjkT0piPXG7rOSlpbNze22YIFzBnJ2DGL9CwNU5NpifNp2aaI7vfX uPdtxtgqXPk4sshIfMcBmL9DvSdhhX5jk98N+U/Ayzqah5lVxyRBD0blLrnVk0+MNg6+ 1bdcXw8BIDHCE2bWUEX52bnR8x+MTPDYTSAsVAgwLCLiwH2R7HTyjRksAg0ppoITFc8f nwUUlC0Epdwk+3ONOsBk7tyrD/PDJHNAfTBzTaf3RgZVCRjsOaXM5O1GDUe7yphUkZYW jzwqarEqd5qNu4u1Ob9erwk1X3zCtRZaZH+/itbI8sCe9WW0JEZywhcyeFfDgV7TSXyk hJXA== MIME-Version: 1.0 X-Received: by 10.224.33.140 with SMTP id h12mr18076626qad.73.1359953475348; Sun, 03 Feb 2013 20:51:15 -0800 (PST) Received: by 10.49.39.99 with HTTP; Sun, 3 Feb 2013 20:51:15 -0800 (PST) In-Reply-To: <1359947162.25449.6074.camel@dellberry> References: <1359947162.25449.6074.camel@dellberry> Date: Mon, 4 Feb 2013 17:51:15 +1300 Message-ID: Subject: Re: unwanted tcp6 protocol in tribes listener socket; From: Vince Stewart To: Tomcat Users List Content-Type: multipart/alternative; boundary=20cf3074d222cf288b04d4ded75f X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074d222cf288b04d4ded75f Content-Type: text/plain; charset=ISO-8859-1 Hi Tim, thanks so much for your reply netstat -t -l yields that includes: Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp6 0 0 myComputerName:4000 [::]:* LISTEN netstat -atn | grep -P ":4000\W" yields (without any headings line) tcp6 0 0 127.0.1.1:4000 :::* LISTEN re But why would you want that limitation? My first aim was to send a single message from home to my VPS or vice versa. When I did not succeed I have been fishing for reasons and the first thing that struck me was that Ubuntu was reporting tpc6 but NioReceiver object "clusterReceiver" had a "bind" property of type Inet4Address and an address of 2130706689 (127.0.0.1). Possibly though, this is a normal IPv6 connection and I should treat it accordingly. I'll give that ago tomorrow morning and keep CATALINA_OPTS in mind as well. Many thanks for your help. On Mon, Feb 4, 2013 at 4:06 PM, Tim Watts wrote: > On Mon, 2013-02-04 at 14:39 +1300, Vince Stewart wrote: > > Using Tomcat 7.0.35 embedded in Java standalone application. Java SE > 1.7.0. > > Ubuntu 12.04 > > > > Hi All, > > > > I have an experimental class below. The aim is just to open a listening > > port on port 4000 in the "localhost" address. > > When this has run, the address for the listener is "127.0.0.1" in other > > words an IPv4 address. > > However the SocksSocketImpl object representing the real socket continues > > to display the* useV4* property as *false* > > and my Ubuntu system displays the listening socket as "tpc6". > > > Listening only for tcp6? What does > netstat -atn | grep -P ":4000\W" > show? > > Perhaps what you want is to set the java.net.preferIPv4Stack system > property in CATALINA_OPTS? Description here: > > http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html > > But why would you want that limitation? > > > > I suspect there is some configuration issue somewhere and if anyone can > > help with this, I would be most grateful. > > > > I have also noted that the java.nio.channels.spi.SelectorProvider cannot > > return a Provider from loadProviderFromProperty() or > loadProviderAsService() > > so therefore issues *provider = > > sun.nio.ch.DefaultSelectorProvider.create()*resulting in a > > ServerSocketChannel that is of type > > *sun.nio.ch.ServerSocketChannelImpl* > > and a ServerSocket of type *sun.nio.ch.ServerSocketAdapter*. I'm not sure > > that these are intended and may be I need a system property named > > "java.nio.channels.spi.SelectorProvider" to ensure some other > > SelectorProvider and therefore different ServerSocketChannel and > > ServerSocket types. > > > > public class TribalAfiliations{ > > Channel myChannel; > > private static class MyMemberListener implements MembershipListener{...} > > private static class MyMessageListener implements ChannelListener{...} > > > > TribalAfiliations() throws SocketException{ > > this.myChannel=new GroupChannel(); > > ChannelListener msgListener = new TribalAfiliations.MyMessageListener(); > > MembershipListener mbrListener = new > TribalAfiliations.MyMemberListener(); > > myChannel.addMembershipListener(mbrListener); > > myChannel.addChannelListener(msgListener); > > try{ > > > > > myChannel.start(Channel.MBR_TX_SEQ|Channel.MBR_RX_SEQ|Channel.SND_TX_SEQ|Channel.SND_RX_SEQ); > > /// same problem, with myChannel.start(Channel.DEFAULT); > > } > > catch(ChannelException e){ > > System.out.println(e.getMessage()); > > } > > } > > > > > > > > > > > > > > -- Vince Stewart --20cf3074d222cf288b04d4ded75f--