@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.Joinable
MessageConnector.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, port
log
ANY_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, stopGracefully
addClosedConnectionStats, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
closeConnections, getBindAddr, getLocalPort, getMaxConnections, setBindAddr, setLocalPort, setMaxConnections, stopAcceptor, stopGracefully
getAddress, getEndpointStats, getFieldReplacer, getName, getPassword, getReconnectDelay, getThreadPriority, getUser, isActive, reconnect, resetEndpointStats, restart, setFieldReplacer, setName, setPassword, setReconnectDelay, setThreadPriority, setUser, start, stop
normalizeBindAddr
awaitProcessed
protected 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 null
public ServerSocketConnector(com.devexperts.connector.proto.ApplicationConnectionFactory factory, int port)
factory
- application connection factory to useport
- TCP port to useNullPointerException
- if factory
is null
public 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 MessageConnector
setStats
in class AbstractMessageConnector
IllegalStateException
- if already set.public boolean isAccepting()
ServerConnectorMBean
isAccepting
in interface ServerConnectorMBean
public MessageConnectorState getState()
MessageConnectorMBean
getState
in interface MessageConnectorMBean
public int getConnectionCount()
MessageConnectorMBean
getConnectionCount
in interface MessageConnectorMBean
public com.devexperts.transport.stats.EndpointStats retrieveCompleteEndpointStats()
MessageConnectorMBean
retrieveCompleteEndpointStats
in interface MessageConnectorMBean
retrieveCompleteEndpointStats
in class AbstractMessageConnector
protected void reconfigure()
reconfigure
in class AbstractMessageConnector
protected void startImpl(boolean startAcceptor)
startImpl
in class AbstractServerConnector
protected AbstractMessageConnector.Joinable stopImpl()
stopImpl
in class AbstractMessageConnector
protected boolean stopAcceptorInternal()
stopAcceptorInternal
in class AbstractServerConnector
protected void startAcceptorInternal()
startAcceptorInternal
in class AbstractServerConnector
protected 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 AbstractServerConnector
Copyright © 2002–2025 Devexperts LLC. All rights reserved.