public class ClientSocket extends Object implements HandshakeCompletedListener
| Constructor and Description |
|---|
ClientSocket(String host,
int port,
InetAddress inaBind)
Creates a new plain socket connection with INI file settings.
|
ClientSocket(String host,
int port,
InetAddress inaBind,
SSLParams params)
Creates a new plain or secured socket connection with SSL
params. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the socket.
|
InputStream |
getInputStream()
Gets the input stream of the socket.
|
OutputStream |
getOutputStream()
Gets the output stream of the socket.
|
X509Certificate |
getServerCertificate()
Gets the server certificate.
|
void |
handshakeCompleted(HandshakeCompletedEvent event)
Called when handshake has completed.
|
void |
setSoTimeout(int timeout)
Sets the socket timeout.
|
void |
setTcpNoDelay(boolean on)
Sets the NO DELAY option for socket.
|
public ClientSocket(String host, int port, InetAddress inaBind) throws IOException
host - The host name or address.port - The destination port.inaBind - The bind address on the local machine to use, or null for none.IOException - For socket errors.public ClientSocket(String host, int port, InetAddress inaBind, SSLParams params) throws IOException
params.host - The host name or address.port - The destination port.inaBind - The bind address on the local machine to use or null for none.params - The SSL parameters instance for a secured socket, or null
for a plain socket.IOException - For socket errors.public void handshakeCompleted(HandshakeCompletedEvent event)
handshakeCompleted in interface HandshakeCompletedListenerevent - Event for completion of handshake.public void setTcpNoDelay(boolean on)
throws SocketException
SocketException - For socket errors.public void setSoTimeout(int timeout)
throws SocketException
SocketException - For socket errors.public InputStream getInputStream() throws IOException
IOException - For socket errors.public OutputStream getOutputStream() throws IOException
IOException - For socket errors.public void close()
throws IOException
IOException - For socket errors.public X509Certificate getServerCertificate()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.