public class ServerConnectionAdapter extends java.lang.Object implements ConnectionAdapter, IncomingEntryReceiver, FlushableOutgoingEntryReceiver
Modifier and Type | Field and Description |
---|---|
NetworkTableConnection |
connection
the connection this adapter uses
|
NULL
Constructor and Description |
---|
ServerConnectionAdapter(IOStream stream,
ServerNetworkTableEntryStore entryStore,
IncomingEntryReceiver transactionReceiver,
ServerAdapterManager adapterListener,
NetworkTableEntryTypeManager typeManager,
NTThreadManager threadManager)
Create a server connection adapter for a given stream
|
Modifier and Type | Method and Description |
---|---|
void |
badMessage(BadMessageException e)
called if a bad message exception is thrown
|
void |
clientHello(char protocolRevision)
Called when the connection receives a client hello message
|
void |
ensureAlive() |
void |
flush() |
ServerConnectionState |
getConnectionState() |
NetworkTableEntry |
getEntry(char id)
get an entry (used by a connection when filling an update entry
|
void |
ioException(java.io.IOException e)
called if an io exception is thrown
|
void |
keepAlive()
Called when the connection receives a keep alive message
|
void |
offerIncomingAssignment(NetworkTableEntry entry) |
void |
offerIncomingUpdate(NetworkTableEntry entry,
char sequenceNumber,
java.lang.Object value) |
void |
offerOutgoingAssignment(NetworkTableEntry entry) |
void |
offerOutgoingUpdate(NetworkTableEntry entry) |
void |
protocolVersionUnsupported(char protocolRevision)
Called when the connection receives a protocol unsupported message
|
void |
serverHelloComplete() |
void |
shutdown(boolean closeStream)
stop the read thread and close the stream
|
public final NetworkTableConnection connection
public ServerConnectionAdapter(IOStream stream, ServerNetworkTableEntryStore entryStore, IncomingEntryReceiver transactionReceiver, ServerAdapterManager adapterListener, NetworkTableEntryTypeManager typeManager, NTThreadManager threadManager)
stream
- transactionPool
- entryStore
- transactionReceiver
- adapterListener
- threadManager
- public void badMessage(BadMessageException e)
ConnectionAdapter
badMessage
in interface ConnectionAdapter
public void ioException(java.io.IOException e)
ConnectionAdapter
ioException
in interface ConnectionAdapter
public void shutdown(boolean closeStream)
public void keepAlive() throws java.io.IOException
ConnectionAdapter
keepAlive
in interface ConnectionAdapter
java.io.IOException
public void clientHello(char protocolRevision) throws java.io.IOException
ConnectionAdapter
clientHello
in interface ConnectionAdapter
java.io.IOException
public void protocolVersionUnsupported(char protocolRevision) throws java.io.IOException
ConnectionAdapter
protocolVersionUnsupported
in interface ConnectionAdapter
protocolRevision
- the protocol version the server reported it supportsjava.io.IOException
public void serverHelloComplete() throws java.io.IOException
serverHelloComplete
in interface ConnectionAdapter
java.io.IOException
public void offerIncomingAssignment(NetworkTableEntry entry)
offerIncomingAssignment
in interface IncomingEntryReceiver
public void offerIncomingUpdate(NetworkTableEntry entry, char sequenceNumber, java.lang.Object value)
offerIncomingUpdate
in interface IncomingEntryReceiver
public NetworkTableEntry getEntry(char id)
ConnectionAdapter
getEntry
in interface ConnectionAdapter
public void offerOutgoingAssignment(NetworkTableEntry entry)
offerOutgoingAssignment
in interface OutgoingEntryReceiver
public void offerOutgoingUpdate(NetworkTableEntry entry)
offerOutgoingUpdate
in interface OutgoingEntryReceiver
public void flush()
flush
in interface FlushableOutgoingEntryReceiver
public ServerConnectionState getConnectionState()
public void ensureAlive()
ensureAlive
in interface FlushableOutgoingEntryReceiver