public class Socket extends Object
Modifier | Constructor and Description |
---|---|
|
Socket() |
|
Socket(InetAddress address,
int port) |
|
Socket(InetAddress host,
int port,
boolean stream)
will always create a Stream Socket ...
|
|
Socket(InetAddress address,
int port,
InetAddress localAddr,
int localPort) |
protected |
Socket(SocketImpl impl) |
|
Socket(String host,
int port) |
|
Socket(String host,
int port,
boolean stream)
will always create a Stream Socket ...
|
|
Socket(String host,
int port,
InetAddress localAddr,
int localPort) |
public Socket()
protected Socket(SocketImpl impl) throws SocketException
SocketException
public Socket(String host, int port) throws UnknownHostException, IOException
UnknownHostException
IOException
public Socket(InetAddress address, int port) throws IOException
IOException
public Socket(String host, int port, InetAddress localAddr, int localPort) throws UnknownHostException, IOException
UnknownHostException
IOException
public Socket(InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException
IOException
public Socket(InetAddress host, int port, boolean stream) throws IOException
IOException
public Socket(String host, int port, boolean stream) throws IOException
IOException
public void connect(SocketAddress sa, int timeout) throws IOException
IOException
public void connect(SocketAddress sa) throws IOException
IOException
public void bind(SocketAddress sa) throws IOException
IOException
public boolean isBound()
public boolean isConnected()
public boolean isClosed()
public void close() throws IOException
IOException
public InetAddress getInetAddress()
public SocketAddress getRemoteSocketAddress()
public InputStream getInputStream() throws IOException
IOException
public InetAddress getLocalAddress()
public int getLocalPort()
public SocketAddress getLocalSocketAddress()
public OutputStream getOutputStream() throws IOException
IOException
public int getPort()
public int getReceiveBufferSize() throws SocketException
SocketException
public int getSendBufferSize() throws SocketException
SocketException
public int getSoLinger() throws SocketException
SocketException
public int getSoTimeout() throws SocketException
SocketException
public boolean getTcpNoDelay() throws SocketException
SocketException
public void setReceiveBufferSize(int size) throws SocketException
SocketException
public void setSendBufferSize(int size) throws SocketException
SocketException
public void setSoLinger(boolean on, int linger) throws SocketException
SocketException
public void setSoTimeout(int timeout) throws SocketException
SocketException
public void setTcpNoDelay(boolean on) throws SocketException
SocketException
public String toString()
Object
public static void setSocketImplFactory(SocketImplFactory fact) throws IOException
IOException
public void shutdownInput() throws IOException
IOException
public boolean isInputShutdown()
public void shutdownOutput() throws IOException
IOException
public boolean isOutputShutdown()
public void setKeepAlive(boolean on) throws SocketException
SocketException
public boolean getKeepAlive() throws SocketException
SocketException
public void sendUrgentData(int udata) throws IOException
IOException
public void setOOBInline(boolean on) throws SocketException
SocketException
public boolean getOOBInline() throws SocketException
SocketException
public void setTrafficClass(int tcl) throws SocketException
SocketException
public int getTrafficClass() throws SocketException
SocketException
public void setReuseAddress(boolean on) throws SocketException
SocketException
public boolean getReuseAddress() throws SocketException
SocketException