1 16 package org.apache.commons.net; 17 18 import java.io.IOException ; 19 import java.net.InetAddress ; 20 import java.net.ServerSocket ; 21 import java.net.Socket ; 22 import java.net.UnknownHostException ; 23 24 37 38 public class DefaultSocketFactory implements SocketFactory 39 { 40 41 50 public Socket createSocket(String host, int port) 51 throws UnknownHostException , IOException 52 { 53 return new Socket (host, port); 54 } 55 56 64 public Socket createSocket(InetAddress address, int port) 65 throws IOException 66 { 67 return new Socket (address, port); 68 } 69 70 82 public Socket createSocket(String host, int port, 83 InetAddress localAddr, int localPort) 84 throws UnknownHostException , IOException 85 { 86 return new Socket (host, port, localAddr, localPort); 87 } 88 89 100 public Socket createSocket(InetAddress address, int port, 101 InetAddress localAddr, int localPort) 102 throws IOException 103 { 104 return new Socket (address, port, localAddr, localPort); 105 } 106 107 116 public ServerSocket createServerSocket(int port) throws IOException 117 { 118 return new ServerSocket (port); 119 } 120 121 132 public ServerSocket createServerSocket(int port, int backlog) 133 throws IOException 134 { 135 return new ServerSocket (port, backlog); 136 } 137 138 151 public ServerSocket createServerSocket(int port, int backlog, 152 InetAddress bindAddr) 153 throws IOException 154 { 155 return new ServerSocket (port, backlog, bindAddr); 156 } 157 } 158 | Popular Tags |