Code example for Socket

Methods: getChannel

   * @param timeout timeout timeout in milliseconds. must not be negative. 
   * @throws IOException 
  public SocketInputStream(Socket socket, long timeout) 
                                         throws IOException { 
    this(socket.getChannel(), timeout);
   * Same as SocketInputStream(socket.getChannel(), socket.getSoTimeout()) 
   * :<br><br> 
   * Create a new input stream with the given timeout. If the timeout 
   * is zero, it will be treated as infinite timeout. The socket's 
   * channel will be configured to be non-blocking. 
   * @see SocketInputStream#SocketInputStream(ReadableByteChannel, long) 
   * @param socket should have a channel associated with it. 
   * @throws IOException