public final class TcpPacketSender extends AbstractTcpPacketHandler implements Runnable
Thread handling the outgoing traffic of a TCP socket. The TcpPacketSender is also responsible for sending keep-alive pings when the connection is idle.
id, lastActivity, listener| Modifier | Constructor and Description |
|---|---|
protected |
TcpPacketSender(TcpPacketTransport transport,
NetworkOutputChannel outputChannel,
PacketTransportListener listener,
int pingInterval,
int sendQueueMaxSize)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
long |
getTimeoutDelay()
Get the maximum allowed time between activities
|
boolean |
needsThrottling() |
boolean |
onActivityTimeout()
Called if the object has been inactive for more
|
void |
pleaseStop() |
void |
run() |
void |
send(AbstractPacket packet)
Send a packet
|
getId, getLastActivityprotected TcpPacketSender(TcpPacketTransport transport, NetworkOutputChannel outputChannel, PacketTransportListener listener, int pingInterval, int sendQueueMaxSize)
public void send(AbstractPacket packet)
public boolean needsThrottling()
public long getTimeoutDelay()
ActiveObjectgetTimeoutDelay in interface ActiveObjectpublic boolean onActivityTimeout()
throws Exception
ActiveObjectonActivityTimeout in interface ActiveObjectExceptionpublic void pleaseStop()
Copyright © 2019. All rights reserved.