question: public Socket createSocket ( InetAddress address , int port , InetAddress myAddress , int myPort ) throws IOException { if ( myAddress != null ) { Socket sock = new Socket ( ) ; sock . bind ( new InetSocketAddress ( myAddress , 0 ) ) ; try { sock . connect ( new InetSocketAddress ( address , port ) , 8000 ) ; } catch ( SocketTimeoutException e ) { throw new ConnectException ( "Socket timeout error (8sec)" + address + ":" + port ) ; } return sock ; } else { Socket sock = new Socket ( ) ; if ( myPort != 0 ) { sock . bind ( new InetSocketAddress ( port ) ) ; } try { sock . connect ( new InetSocketAddress ( address , port ) , 8000 ) ; } catch ( SocketTimeoutException e ) { throw new ConnectException ( "Socket timeout error (8sec)" + address + ":" + port ) ; } return sock ; } }
target:  Creates a new Socket, binds it to myAddress:myPort and connects it to address:port.