Package com.iizix.comm
Class SocketComm
- java.lang.Object
- com.iizix.nio.SocketCommNIO
- com.iizix.comm.SocketComm
- All Implemented Interfaces:
ISocketComm
,IWorkerTimeout
public class SocketComm extends SocketCommNIO
The SocketComm class is used to open client sockets with a destination host with optional proxy (HTTP/SOCKS), secure socket (SSL/TLS), and atop WebSocket or Telnet as protocols.For proxy and/or WebSocket, an authenticator must/should be used to support user authentication with the proxy or destination (for WebSocket).
For SSL/TLS, client certificates can be added, discrete or from system, and if so, an password callback might be have to be registered to provide a password for a keystore or a certificate, unless preset in the properties.
For SSL/TLS, server certificates validator can be provided in order to check server certificates and/or the destinations host name.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class com.iizix.nio.SocketCommNIO
SocketCommNIO.State
Field Summary
Fields Modifier and Type Field Description SocketCommProps
properties
The properties for the socket.Fields inherited from class com.iizix.nio.SocketCommNIO
bindAddress, doResolveHostNames, host, port
Constructor Summary
Constructors Constructor Description SocketComm(SocketCommProps properties, Worker worker, SocketCommListener listener, javax.net.ssl.SSLEngine engine)
Creates a new Socket Client Communication channel as UNINITIALIZED.
Method Summary
Methods inherited from class com.iizix.nio.SocketCommNIO
checkTimeout, close, close, enterSecureMode, getNonConnectedReadTimeout, getReadTimeout, getRemainingTimeout, getRemoteAddr, getRemoteHost, getSocketAddress, getSSLCommLayer, getState, getWriteTimeout, hasBeenOpen, isClosed, isSecure, open, process, send, setLogger, setNonConnectedReadTimeout, setReadTimeout, setupSocket, setWriteTimeout
Field Detail
properties
public final SocketCommProps properties
The properties for the socket.
Constructor Detail
SocketComm
public SocketComm(SocketCommProps properties, Worker worker, SocketCommListener listener, javax.net.ssl.SSLEngine engine)
Creates a new Socket Client Communication channel as UNINITIALIZED.- Parameters:
properties
- The socket properties.worker
- The worker thread for socket processing.listener
- The listener for socket events.engine
- The SSL engine or null for plain connection.