public class TcpSocket extends Object implements ISocket
| Constructor and Description |
|---|
TcpSocket() |
TcpSocket(Socket socket)
Creates a TcpSocket on a pre-connected socket
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Formally closes the connection
|
void |
connect(InetSocketAddress endpoint)
Connects the underlaying Socket to the endpoint
|
boolean |
equals(Object o) |
void |
flush()
Forces the socket to send all data
|
InputStream |
getInputStream()
Gets the inputstream from the underlaying socket
|
OutputStream |
getOutputStream()
Gets the outputstream from the underlaying socket
|
int |
hashCode() |
boolean |
isClosed()
Checks if the connection has been closed
|
boolean |
isInputShutdown()
Checks if there will be no more data incoming
|
boolean |
isOutputShutdown()
Checks if no more data can be send on this socket
|
String |
toString() |
public TcpSocket()
public TcpSocket(Socket socket)
socket - The underlying TCP socketpublic void connect(InetSocketAddress endpoint) throws IOException
ISocketconnect in interface ISocketendpoint - The Address to connect toIOException - When connection failspublic InputStream getInputStream() throws IOException
ISocketgetInputStream in interface ISocketIOException - when the stream could not be createdpublic OutputStream getOutputStream() throws IOException
ISocketgetOutputStream in interface ISocketIOException - when the stream could not be createdpublic void close()
throws IOException
ISocketclose in interface AutoCloseableclose in interface ISocketIOException - When the connection could not be closedpublic boolean isClosed()
ISocketpublic boolean isInputShutdown()
ISocketisInputShutdown in interface ISocketpublic boolean isOutputShutdown()
ISocketisOutputShutdown in interface ISocketpublic void flush()
throws IOException
ISocketflush in interface ISocketIOExceptionCopyright © 2016. All rights reserved.