java.net
Class Socket

java.lang.Object
  extended by java.net.Socket
Direct Known Subclasses:
SSLSocket


public class Socket
extends Object


Constructor Summary
  Socket()
           
  Socket(InetAddress address, int port)
           
  Socket(InetAddress remoteHost, int remotePort, InetAddress localHost, int localPort)
           
protected Socket(SocketImpl impl)
           
  Socket(String host, int port)
           
  Socket(String remoteHost, int remotePort, InetAddress localHost, int localPort)
           
 
Method Summary
 void close()
           
 void connect(SocketAddress endpoint)
           
 void connect(SocketAddress endpoint, int timeout)
           
 InetAddress getInetAddress()
           
 InputStream getInputStream()
           
 boolean getKeepAlive()
           
 InetAddress getLocalAddress()
           
 int getLocalPort()
           
 boolean getOOBInline()
           
 OutputStream getOutputStream()
           
 int getPort()
           
 int getReceiveBufferSize()
           
 boolean getReuseAddress()
           
 int getSendBufferSize()
           
 int getSoLinger()
           
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 int getTrafficClass()
           
 void sendUrgentData(int data)
           
 void setKeepAlive(boolean on)
           
 void setOOBInline(boolean on)
           
 void setReceiveBufferSize(int size)
           
 void setReuseAddress(boolean on)
           
 void setSendBufferSize(int size)
           
static void setSocketImplFactory(SocketImplFactory fac)
           
 void setSoLinger(boolean on, int linger)
           
 void setSoTimeout(int timeoutMs)
           
 void setTcpNoDelay(boolean noDelay)
           
 void setTrafficClass(int tc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Socket

public Socket()

Socket

protected Socket(SocketImpl impl)
          throws SocketException
Throws:
SocketException

Socket

public Socket(String host,
              int port)
       throws IOException,
              UnknownHostException
Throws:
IOException
UnknownHostException

Socket

public Socket(InetAddress address,
              int port)
       throws IOException
Throws:
IOException

Socket

public Socket(String remoteHost,
              int remotePort,
              InetAddress localHost,
              int localPort)
       throws IOException
Throws:
IOException

Socket

public Socket(InetAddress remoteHost,
              int remotePort,
              InetAddress localHost,
              int localPort)
       throws IOException
Throws:
IOException
Method Detail

connect

public void connect(SocketAddress endpoint)
             throws IOException,
                    IllegalArgumentException
Throws:
IOException
IllegalArgumentException

connect

public void connect(SocketAddress endpoint,
                    int timeout)
             throws IOException
Throws:
IOException

getInetAddress

public InetAddress getInetAddress()

getLocalAddress

public InetAddress getLocalAddress()

getPort

public int getPort()

getLocalPort

public int getLocalPort()

getInputStream

public InputStream getInputStream()
                           throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Throws:
IOException

setTcpNoDelay

public void setTcpNoDelay(boolean noDelay)
                   throws SocketException
Throws:
SocketException

getTcpNoDelay

public boolean getTcpNoDelay()
                      throws SocketException
Throws:
SocketException

setSoLinger

public void setSoLinger(boolean on,
                        int linger)
                 throws SocketException,
                        IllegalArgumentException
Throws:
SocketException
IllegalArgumentException

getSoLinger

public int getSoLinger()
                throws SocketException
Throws:
SocketException

sendUrgentData

public void sendUrgentData(int data)
                    throws IOException
Throws:
IOException

setOOBInline

public void setOOBInline(boolean on)
                  throws SocketException
Throws:
SocketException

getOOBInline

public boolean getOOBInline()
                     throws SocketException
Throws:
SocketException

setSoTimeout

public void setSoTimeout(int timeoutMs)
                  throws SocketException
Throws:
SocketException

getSoTimeout

public int getSoTimeout()
                 throws SocketException
Throws:
SocketException

setSendBufferSize

public void setSendBufferSize(int size)
                       throws SocketException,
                              IllegalArgumentException
Throws:
SocketException
IllegalArgumentException

getSendBufferSize

public int getSendBufferSize()
                      throws SocketException
Throws:
SocketException

setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws SocketException,
                                 IllegalArgumentException
Throws:
SocketException
IllegalArgumentException

getReceiveBufferSize

public int getReceiveBufferSize()
                         throws SocketException
Throws:
SocketException

setKeepAlive

public void setKeepAlive(boolean on)
                  throws SocketException
Throws:
SocketException

getKeepAlive

public boolean getKeepAlive()
                     throws SocketException
Throws:
SocketException

setTrafficClass

public void setTrafficClass(int tc)
                     throws SocketException,
                            IllegalArgumentException
Throws:
SocketException
IllegalArgumentException

getTrafficClass

public int getTrafficClass()
                    throws SocketException
Throws:
SocketException

setReuseAddress

public void setReuseAddress(boolean on)
                     throws SocketException
Throws:
SocketException

getReuseAddress

public boolean getReuseAddress()
                        throws SocketException
Throws:
SocketException

close

public void close()
           throws IOException
Throws:
IOException

setSocketImplFactory

public static void setSocketImplFactory(SocketImplFactory fac)
                                 throws IOException
Throws:
IOException