public class TcpServer extends BaseServer<Address,TcpConnection>
Modifier and Type | Class and Description |
---|---|
protected class |
TcpServer.Acceptor |
BaseServer.ConnectionListener<A,V extends Connection>, BaseServer.Reaper
Modifier and Type | Field and Description |
---|---|
protected java.lang.Thread |
acceptor |
protected int |
peer_addr_read_timeout |
protected int |
send_queue_size |
protected java.net.ServerSocket |
srv_sock |
protected boolean |
use_send_queues |
client_bind_addr, client_bind_port, conn_expire_time, conn_listeners, conns, defer_client_binding, factory, linger, local_addr, log, reaper, reaperInterval, receiver, recv_buf_size, running, send_buf_size, sock_conn_timeout, sock_creation_lock, socket_factory, tcp_nodelay, time_service
Constructor and Description |
---|
TcpServer(java.net.InetAddress bind_addr,
int port) |
TcpServer(IpAddress local_addr) |
TcpServer(java.lang.String service_name,
ThreadFactory f,
SocketFactory socket_factory,
Receiver<Address> r,
java.net.InetAddress bind_addr,
java.net.InetAddress external_addr,
int external_port,
int srv_port,
int max_port,
long reaper_interval,
long conn_expire_time) |
Modifier and Type | Method and Description |
---|---|
protected TcpConnection |
createConnection(Address dest)
Creates a new connection object to target dest, but doesn't yet connect it
|
int |
peerAddressReadTimeout() |
TcpServer |
peerAddressReadTimeout(int timeout) |
int |
sendQueueSize() |
TcpServer |
sendQueueSize(int send_queue_size) |
void |
start()
Starts the server.
|
void |
stop()
Stops the server, e.g.
|
boolean |
useSendQueues() |
TcpServer |
useSendQueues(boolean flag) |
addConnection, addConnectionListener, clientBindAddress, clientBindAddress, clientBindPort, clientBindPort, close, connectionEstablishedTo, connExpireTime, connExpireTimeout, deferClientBinding, deferClientBinding, explanation, getConnection, getNumConnections, getNumOpenConnections, hasConnection, linger, linger, localAddress, log, log, notifyConnectionClosed, notifyConnectionOpened, printConnections, reaperInterval, reaperInterval, receive, receive, receiveBufferSize, receiveBufferSize, receiver, receiver, removeConnectionIfPresent, removeConnectionListener, replaceConnection, retainAll, send, send, sendBufferSize, sendBufferSize, socketConnectionTimeout, socketConnectionTimeout, socketFactory, socketFactory, tcpNodelay, tcpNodelay, timeService, timeService, toString, validateArgs
protected final java.net.ServerSocket srv_sock
protected final java.lang.Thread acceptor
protected volatile boolean use_send_queues
protected int send_queue_size
protected int peer_addr_read_timeout
public TcpServer(IpAddress local_addr) throws java.lang.Exception
java.lang.Exception
public TcpServer(java.net.InetAddress bind_addr, int port) throws java.lang.Exception
java.lang.Exception
public TcpServer(java.lang.String service_name, ThreadFactory f, SocketFactory socket_factory, Receiver<Address> r, java.net.InetAddress bind_addr, java.net.InetAddress external_addr, int external_port, int srv_port, int max_port, long reaper_interval, long conn_expire_time) throws java.lang.Exception
java.lang.Exception
public int peerAddressReadTimeout()
public TcpServer peerAddressReadTimeout(int timeout)
public int sendQueueSize()
public TcpServer sendQueueSize(int send_queue_size)
public boolean useSendQueues()
public TcpServer useSendQueues(boolean flag)
public void start() throws java.lang.Exception
Server
start
in interface Server<Address>
start
in class BaseServer<Address,TcpConnection>
java.lang.Exception
public void stop()
Server
stop
in interface Server<Address>
stop
in class BaseServer<Address,TcpConnection>
protected TcpConnection createConnection(Address dest) throws java.lang.Exception
BaseServer
createConnection
in class BaseServer<Address,TcpConnection>
java.lang.Exception
Copyright © 1998-2020 Red Hat. All Rights Reserved.