Class net.Socket
All Packages    This Package    Previous    Next

Class net.Socket

java.lang.Object
   |
   +----net.Socket

public final class Socket
extends Object
This is the basic socket class. It is currently 'SOCKSified' so if you have SOCKS_HOST and SOCKS_PORT set, and the address cannot be connected to locally, then we try going through sockd.
Author:
Jonathan Payne, Chuck McManis
Version:
1.16, 15 May 1995

address
address this socket is bound to
inputStream
file for doing input on this socket
outputStream
file for doing output to other end
port
Port this socket is bound to in network byte order.

Socket(boolean)
Create a socket which is a TCP socket if isStream is true, or is a UDP socket otherwise.
Socket(String, int)
Create a TCP socket and connect it to the specified port on the specified host.

SOCKSAccept()
SOCKSBind(InetAddress, Socket)
Create a bound socket on the other side of a SOCKS firewall.
accept()
Accept a connection on this socket, returning a new one.
bindAnonymously(InetAddress)
Bind this socket to a local address.
bindToPort(InetAddress, int)
Bind this socket to a known port at the specified address.
close()
Close the connection.
connect(InetAddress, int)
Connect this socket to the specified destination and port.
finalize()
initialize()
This does nothing except provide an entry point for other related packages to cause the above static initializer to run.
listen(int)
Specify how many connections can attempt to connect to this socket at once before getting an error.
toString()
usingSOCKS()
This method returns the state of the isSOCKSSocket variable.

address
  public InetAddress address
address this socket is bound to
port
  public int port
Port this socket is bound to in network byte order.
inputStream
  public FileInputStream inputStream
file for doing input on this socket
outputStream
  public FileOutputStream outputStream
file for doing output to other end

Socket
  public Socket(boolean isStream)
Create a socket which is a TCP socket if isStream is true, or is a UDP socket otherwise.

Socket

  public Socket(String host,
                int port)
Create a TCP socket and connect it to the specified port on the specified host.

listen
  public void listen(int count)
Specify how many connections can attempt to connect to this socket at once before getting an error.

initialize

  public static void initialize()
This does nothing except provide an entry point for other related packages to cause the above static initializer to run.

bindAnonymously

  public void bindAnonymously(InetAddress addr)
Bind this socket to a local address.

bindToPort

  public void bindToPort(InetAddress addr,
                         int port)
Bind this socket to a known port at the specified address.

connect

  public void connect(InetAddress dest,
                      int port)
Connect this socket to the specified destination and port. Throws an exception if this fails.

accept

  public Socket accept()
Accept a connection on this socket, returning a new one. The old socket is still around for listening for new connections.

SOCKSAccept

  public Socket SOCKSAccept()
usingSOCKS
  public boolean usingSOCKS()
This method returns the state of the isSOCKSSocket variable. It has to be a method to prevent the variable from being overwritten my malicious programs.

SOCKSBind

  public void SOCKSBind(InetAddress addr,
                        Socket remHost)
Create a bound socket on the other side of a SOCKS firewall.

close

  public synchronized void close()
Close the connection. Other end will get EOF on reads, and SIGPIPE on writes.

toString

  public String toString()
finalize
  protected void finalize()

All Packages    This Package    Previous    Next