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
IOExceptionpublic Socket(String host, int port) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic Socket(String host, int port, InetAddress localAddress, int localPort) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionpublic Socket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
IOExceptionpublic boolean isClosed()
public void close()
throws IOException
IOExceptionpublic boolean isConnected()
public boolean isBound()
public int getLocalPort()
public int getPort()
public InetAddress getLocalAddress()
public InetAddress getInetAddress()
public int getSoLinger()
throws SocketException
SocketExceptionpublic void setSoLinger(boolean on,
int value)
throws SocketException
SocketExceptionpublic boolean getTcpNoDelay()
throws SocketException
SocketExceptionpublic void setTcpNoDelay(boolean on)
throws SocketException
SocketExceptionpublic boolean getKeepAlive()
throws SocketException
SocketExceptionpublic void setKeepAlive(boolean on)
throws SocketException
SocketExceptionpublic OutputStream getOutputStream() throws IOException
IOExceptionpublic void shutdownOutput()
throws IOException
IOExceptionpublic boolean isOutputShutdown()
public InputStream getInputStream() throws IOException
IOExceptionpublic void shutdownInput()
throws IOException
IOExceptionpublic boolean isInputShutdown()
protected void finalize()
throws Throwable
ObjectThe 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
SocketExceptionpublic void setSoTimeout(int timeout)
throws SocketException
SocketException