java.net
Class Socket
java.lang.Object
java.net.Socket
- Direct Known Subclasses:
- SSLSocket
public class Socket
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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