Code example for SocketFactory

Methods: createSocket

0
                    factory = (SSLSocketFactory) context.getSocketFactory ();
                } 
                else 
                    factory = SSLSocketFactory.getDefault();
                 
                socket = factory.createSocket( host, port );
            } 
             
             
            socket.setTcpNoDelay( true );
 
            // workaround for android issu => close on socket doesnt throw ex.  
            socket.setSoTimeout( 5000 );
 
            input = socket.getInputStream();
         
            String handshake = "GET " + path + " HTTP/1.1\r\n" +
                                "Upgrade: WebSocket\r\n" + 
                                "Connection: Upgrade\r\n" + 
                                "Host: " + host + "\r\n" +
                                "Origin: http://" + host