Code example for SocketFactory

Methods: createSocket

public class PollingProtocolSocketFactory implements SchemeSocketFactory { 
	private final static SocketFactory factory = SocketFactory.getDefault();
	public Socket createSocket(HttpParams params) throws IOException {
		return NetUtil.configureSocket(factory.createSocket());
	public Socket connectSocket(Socket sock, InetSocketAddress remoteAddress, InetSocketAddress localAddress,
			HttpParams params) throws IOException, UnknownHostException, ConnectTimeoutException {
		if (params == null) {
			throw new IllegalArgumentException("Parameters may not be null"); //$NON-NLS-1$
		final Socket socket = sock != null ? sock : NetUtil.configureSocket(factory.createSocket());
		int connTimeout = HttpConnectionParams.getConnectionTimeout(params);
Stop searching for code, let great code find you!  Add Codota to your java IDE