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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]