Code example for SocketFactory

Methods: createSocket

0
     *  derived from it. 
     */ 
    public void connect(InetAddress host, int port)
    throws SocketException, IOException 
    { 
        _socket_ = _socketFactory_.createSocket();
        if (receiveBufferSize != -1) {
            _socket_.setReceiveBufferSize(receiveBufferSize);
        } 
        if (sendBufferSize != -1) {
            _socket_.setSendBufferSize(sendBufferSize);
        } 
        _socket_.connect(new InetSocketAddress(host, port), connectTimeout);
        _connectAction_(); 
    } 
 
    /** 
     * Opens a Socket connected to a remote host at the specified port and 
     * originating from the current host at a system assigned port. 
     * Before returning, {@link #_connectAction_  _connectAction_() } 
     * is called to perform connection initialization actions.