public class ClientConnectionAdapter extends java.lang.Object implements ConnectionAdapter, IncomingEntryReceiver, FlushableOutgoingEntryReceiver
NULL| Constructor and Description |
|---|
ClientConnectionAdapter(ClientNetworkTableEntryStore entryStore,
NTThreadManager threadManager,
IOStreamFactory streamFactory,
ClientConnectionListenerManager connectionListenerManager,
NetworkTableEntryTypeManager typeManager)
Create a new ClientConnectionAdapter
|
| 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 |
close()
Close the client connection
|
void |
close(ClientConnectionState newState)
Close the connection to the server and enter the given state
|
void |
ensureAlive() |
void |
flush() |
ClientConnectionState |
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
|
boolean |
isConnected() |
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 |
reconnect()
Reconnect the client to the server (even if the client is not currently connected)
|
void |
serverHelloComplete() |
public ClientConnectionAdapter(ClientNetworkTableEntryStore entryStore, NTThreadManager threadManager, IOStreamFactory streamFactory, ClientConnectionListenerManager connectionListenerManager, NetworkTableEntryTypeManager typeManager)
entryStore - threadManager - streamFactory - transactionPool - connectionListenerManager - public ClientConnectionState getConnectionState()
public boolean isConnected()
public void reconnect()
public void close()
public void close(ClientConnectionState newState)
newState - public void badMessage(BadMessageException e)
ConnectionAdapterbadMessage in interface ConnectionAdapterpublic void ioException(java.io.IOException e)
ConnectionAdapterioException in interface ConnectionAdapterpublic NetworkTableEntry getEntry(char id)
ConnectionAdaptergetEntry in interface ConnectionAdapterpublic 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)
ConnectionAdapterprotocolVersionUnsupported in interface ConnectionAdapterprotocolRevision - the protocol version the server reported it supportspublic 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 void offerOutgoingAssignment(NetworkTableEntry entry)
offerOutgoingAssignment in interface OutgoingEntryReceiverpublic void offerOutgoingUpdate(NetworkTableEntry entry)
offerOutgoingUpdate in interface OutgoingEntryReceiverpublic void flush()
flush in interface FlushableOutgoingEntryReceiverpublic void ensureAlive()
ensureAlive in interface FlushableOutgoingEntryReceiver