@MessageConnectorSummary(info="Creates server TCP/IP socket connection.", addressFormat=":<port>") public class ServerSocketConnector extends AbstractServerConnector implements ServerSocketConnectorMBean
ServerSocketConnector handles standard server socket using blocking API.AbstractMessageConnector.JoinableMessageConnector.Bindable| Modifier and Type | Field and Description |
|---|---|
protected com.devexperts.qd.qtp.socket.SocketAcceptor |
acceptor |
protected SocketHandler.CloseListener |
closeListener |
protected Set<com.devexperts.qd.qtp.socket.SocketHandler> |
handlers |
protected boolean |
useTls |
active, bindAddress, bindAddressString, maxConnections, portlogANY_BIND_ADDRESS| Constructor and Description |
|---|
ServerSocketConnector(com.devexperts.connector.proto.ApplicationConnectionFactory factory,
int port)
Creates new server socket connector.
|
ServerSocketConnector(MessageAdapter.Factory factory,
int port)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHandler(com.devexperts.qd.qtp.socket.SocketHandler handler) |
int |
getConnectionCount()
Number of established connections
|
protected List<Closeable> |
getConnections() |
MessageConnectorState |
getState()
State of connector.
|
boolean |
getTls() |
protected void |
handlerClosed(com.devexperts.qd.qtp.socket.SocketHandler handler) |
boolean |
isAccepting()
Checks whether the connection can be accepted
|
protected boolean |
isNewConnectionAllowed() |
protected void |
reconfigure() |
com.devexperts.transport.stats.EndpointStats |
retrieveCompleteEndpointStats()
Retrieves endpoint statistics for this message connector since its creation
|
void |
setStats(QDStats stats)
Sets stats for this connector.
|
void |
setTls(boolean useTls) |
protected void |
startAcceptorInternal() |
protected void |
startImpl(boolean startAcceptor) |
protected boolean |
stopAcceptorInternal() |
protected AbstractMessageConnector.Joinable |
stopImpl() |
cancelScheduledTask, closeConnections, getAddress, getBindAddr, getBindInetAddress, getLocalPort, getMaxConnections, isActive, setBindAddr, setLocalPort, setMaxConnections, start, stopAcceptor, stopGracefullyaddClosedConnectionStats, addMessageConnectorListener, close, closeImpl, getClosedConnectionCount, getEndpointStats, getFactory, getFieldReplacer, getLogging, getName, getPassword, getReconnectDelay, getStats, getThreadPriority, getUser, handlerClosed, isClosed, notifyMessageConnectorListeners, reconnect, removeMessageConnectorListener, resetEndpointStats, restart, restartImpl, setFactory, setFieldReplacer, setName, setPassword, setReconnectDelay, setThreadPriority, setUser, stop, stopAndWait, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloseConnections, getBindAddr, getLocalPort, getMaxConnections, setBindAddr, setLocalPort, setMaxConnections, stopAcceptor, stopGracefullygetAddress, getEndpointStats, getFieldReplacer, getName, getPassword, getReconnectDelay, getThreadPriority, getUser, isActive, reconnect, resetEndpointStats, restart, setFieldReplacer, setName, setPassword, setReconnectDelay, setThreadPriority, setUser, start, stopnormalizeBindAddrawaitProcessedprotected volatile boolean useTls
protected final Set<com.devexperts.qd.qtp.socket.SocketHandler> handlers
protected final SocketHandler.CloseListener closeListener
protected volatile com.devexperts.qd.qtp.socket.SocketAcceptor acceptor
@Deprecated public ServerSocketConnector(MessageAdapter.Factory factory, int port)
ServerSocketConnector(ApplicationConnectionFactory, int)factory - message adapter factory to useport - TCP port to useNullPointerException - if factory is nullpublic ServerSocketConnector(com.devexperts.connector.proto.ApplicationConnectionFactory factory,
int port)
factory - application connection factory to useport - TCP port to useNullPointerException - if factory is nullpublic boolean getTls()
public void setTls(boolean useTls)
public void setStats(QDStats stats)
QDStats.SType#SERVER_SOCKET_CONNECTOR or
a suitable substitute. This method may be invoked only once.setStats in interface MessageConnectorsetStats in class AbstractMessageConnectorIllegalStateException - if already set.public boolean isAccepting()
ServerConnectorMBeanisAccepting in interface ServerConnectorMBeanpublic MessageConnectorState getState()
MessageConnectorMBeangetState in interface MessageConnectorMBeanpublic int getConnectionCount()
MessageConnectorMBeangetConnectionCount in interface MessageConnectorMBeanpublic com.devexperts.transport.stats.EndpointStats retrieveCompleteEndpointStats()
MessageConnectorMBeanretrieveCompleteEndpointStats in interface MessageConnectorMBeanretrieveCompleteEndpointStats in class AbstractMessageConnectorprotected void reconfigure()
reconfigure in class AbstractMessageConnectorprotected void startImpl(boolean startAcceptor)
startImpl in class AbstractServerConnectorprotected AbstractMessageConnector.Joinable stopImpl()
stopImpl in class AbstractMessageConnectorprotected boolean stopAcceptorInternal()
stopAcceptorInternal in class AbstractServerConnectorprotected void startAcceptorInternal()
startAcceptorInternal in class AbstractServerConnectorprotected void addHandler(com.devexperts.qd.qtp.socket.SocketHandler handler)
protected void handlerClosed(com.devexperts.qd.qtp.socket.SocketHandler handler)
protected boolean isNewConnectionAllowed()
protected List<Closeable> getConnections()
getConnections in class AbstractServerConnectorCopyright © 2002–2025 Devexperts LLC. All rights reserved.