public class Socket extends Object
Constructor and Description |
---|
Socket(InetAddress address,
int port) |
Socket(InetAddress address,
int port,
InetAddress localAddress,
int localPort) |
Socket(String host,
int port) |
Socket(String host,
int port,
InetAddress localAddress,
int localPort) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize()
This method (when overriden), will be called when the VM determines that the Object can be
garbage collected.
|
InetAddress |
getInetAddress() |
InputStream |
getInputStream() |
boolean |
getKeepAlive() |
InetAddress |
getLocalAddress() |
int |
getLocalPort() |
OutputStream |
getOutputStream() |
int |
getPort() |
int |
getSoLinger() |
int |
getSoTimeout() |
boolean |
getTcpNoDelay() |
boolean |
isBound() |
boolean |
isClosed() |
boolean |
isConnected() |
boolean |
isInputShutdown() |
boolean |
isOutputShutdown() |
void |
setKeepAlive(boolean on) |
void |
setSoLinger(boolean on,
int value) |
void |
setSoTimeout(int timeout) |
void |
setTcpNoDelay(boolean on) |
void |
shutdownInput() |
void |
shutdownOutput() |
public Socket(InetAddress address, int port) throws IOException
IOException
public Socket(String host, int port) throws UnknownHostException, IOException
UnknownHostException
IOException
public Socket(String host, int port, InetAddress localAddress, int localPort) throws UnknownHostException, IOException
UnknownHostException
IOException
public Socket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
IOException
public boolean isClosed()
public void close() throws IOException
IOException
public boolean isConnected()
public boolean isBound()
public int getLocalPort()
public int getPort()
public InetAddress getLocalAddress()
public InetAddress getInetAddress()
public int getSoLinger() throws SocketException
SocketException
public void setSoLinger(boolean on, int value) throws SocketException
SocketException
public boolean getTcpNoDelay() throws SocketException
SocketException
public void setTcpNoDelay(boolean on) throws SocketException
SocketException
public boolean getKeepAlive() throws SocketException
SocketException
public void setKeepAlive(boolean on) throws SocketException
SocketException
public OutputStream getOutputStream() throws IOException
IOException
public void shutdownOutput() throws IOException
IOException
public boolean isOutputShutdown()
public InputStream getInputStream() throws IOException
IOException
public void shutdownInput() throws IOException
IOException
public boolean isInputShutdown()
protected void finalize() throws Throwable
Object
The finalize() method of a Class is only called if it overrides finalize() - the finalize() method java.lang.Object is never called by the Eve VM.
public int getSoTimeout() throws SocketException
SocketException
public void setSoTimeout(int timeout) throws SocketException
SocketException