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)
ConnectionAdapterbadMessage in interface ConnectionAdapterpublic void ioException(java.io.IOException e)
ConnectionAdapterioException in interface ConnectionAdapterpublic void shutdown(boolean closeStream)
public void keepAlive() throws java.io.IOException
ConnectionAdapterkeepAlive in interface ConnectionAdapterjava.io.IOExceptionpublic void clientHello(char protocolRevision) throws java.io.IOException
ConnectionAdapterclientHello in interface ConnectionAdapterjava.io.IOExceptionpublic void protocolVersionUnsupported(char protocolRevision) throws java.io.IOException
ConnectionAdapterprotocolVersionUnsupported in interface ConnectionAdapterprotocolRevision - the protocol version the server reported it supportsjava.io.IOExceptionpublic void serverHelloComplete() throws java.io.IOException
serverHelloComplete in interface ConnectionAdapterjava.io.IOExceptionpublic void offerIncomingAssignment(NetworkTableEntry entry)
offerIncomingAssignment in interface IncomingEntryReceiverpublic void offerIncomingUpdate(NetworkTableEntry entry, char sequenceNumber, java.lang.Object value)
offerIncomingUpdate in interface IncomingEntryReceiverpublic NetworkTableEntry getEntry(char id)
ConnectionAdaptergetEntry in interface ConnectionAdapterpublic void offerOutgoingAssignment(NetworkTableEntry entry)
offerOutgoingAssignment in interface OutgoingEntryReceiverpublic void offerOutgoingUpdate(NetworkTableEntry entry)
offerOutgoingUpdate in interface OutgoingEntryReceiverpublic void flush()
flush in interface FlushableOutgoingEntryReceiverpublic ServerConnectionState getConnectionState()
public void ensureAlive()
ensureAlive in interface FlushableOutgoingEntryReceiver