Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 86335 invoked from network); 10 Jan 2005 19:00:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Jan 2005 19:00:02 -0000 Received: (qmail 38682 invoked by uid 500); 10 Jan 2005 18:59:51 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 38620 invoked by uid 500); 10 Jan 2005 18:59:51 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 38552 invoked by uid 99); 10 Jan 2005 18:59:51 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from victor.wilshire.com (HELO victor.wilshire.com) (209.0.86.70) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 10 Jan 2005 10:59:49 -0800 Received: from sneezy.wilshire.com (sneezy.wilshire.com [192.168.14.22]) by victor.wilshire.com (8.12.3/8.12.3/Debian-6.6) with ESMTP id j0AIxaJG015734 for ; Mon, 10 Jan 2005 10:59:36 -0800 Received: from bbarkerxp (foundry.wilshire.com [192.168.1.129] (may be forged)) by sneezy.wilshire.com (8.12.9/8.12.3) with SMTP id j0AIv506010760 for ; Mon, 10 Jan 2005 10:57:05 -0800 (PST) Message-ID: <003301c4f746$8bdcc7d0$cb37a8c0@bbarkerxp> From: "Bill Barker" To: "Tomcat Developers List" References: Subject: Re: Custom Socket Factory in 5.0.28 (previously unanswered in tomcat-user) Date: Mon, 10 Jan 2005 10:59:43 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1105383576-11203-46" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Zantaz-Archived: victor X-Scanned-By: MIMEDefang 2.44 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------------=_1105383576-11203-46 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline The element under the is deprecated, and doesn't do very much. If you're not using SSL (i.e. secure="false" on the ), then you need your class to extend o.a.t.u.net.ServerSocketFactory and set socketFactory="fully.qualified.name.of.my.SocketFactory" on the . ----- Original Message ----- From: "James Richardson" To: Sent: Monday, January 10, 2005 10:03 AM Subject: Custom Socket Factory in 5.0.28 (previously unanswered in tomcat-user) > > Hi, > > I'm playing around with P2PSockets and thought it might be fun to plug > into tomcat. > > I've written a (very trivial) class to implement the ServerSocketFactory > interface, but I'm not too sure how to make the Connector use it. > > I read of a Factory element that goes within a Context element, but > couldn't find any more about it. > > If anybody could point me in the right direction, would be much > appreciative. > > Thanks! > > James > > > package com.xx.es.jxta.tomcat.connector; > > import org.apache.catalina.net.ServerSocketFactory; > import org.p2psockets.P2PServerSocket; > import org.p2psockets.P2PNetwork; > > import java.net.ServerSocket; > import java.net.InetAddress; > import java.io.IOException; > import java.security.KeyStoreException; > import java.security.NoSuchAlgorithmException; > import java.security.UnrecoverableKeyException; > import java.security.KeyManagementException; > import java.security.cert.CertificateException; > > /** > * $Header$ > */ > public class JxtaServerSocketFactory implements ServerSocketFactory { > > protected static boolean initialised = false; > > protected static synchronized void init() throws IOException { > if (!initialised) { > try { > P2PNetwork.signin(); > initialised = true; > } catch (Exception e) { > throw new IOException(e.toString()); > } > } > } > > public ServerSocket createSocket(int port) throws IOException, > KeyStoreException, NoSuchAlgorithmException, CertificateException, > UnrecoverableKeyException, KeyManagementException { > init(); > return new P2PServerSocket(port); > } > > public ServerSocket createSocket(int port, int backlog) throws > IOException, KeyStoreException, NoSuchAlgorithmException, > CertificateException, UnrecoverableKeyException, KeyManagementException { > init(); > return new P2PServerSocket(port, backlog); > } > > public ServerSocket createSocket(int port, int backlog, InetAddress > ifAddress) throws IOException, KeyStoreException, > NoSuchAlgorithmException, CertificateException, UnrecoverableKeyException, > KeyManagementException { > init(); > return new P2PServerSocket(port, backlog, ifAddress); > } > } > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. ------------=_1105383576-11203-46 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org ------------=_1105383576-11203-46--