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)
ConnectionAdapter
badMessage
in interface ConnectionAdapter
public void ioException(java.io.IOException e)
ConnectionAdapter
ioException
in interface ConnectionAdapter
public NetworkTableEntry getEntry(char id)
ConnectionAdapter
getEntry
in interface ConnectionAdapter
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)
ConnectionAdapter
protocolVersionUnsupported
in interface ConnectionAdapter
protocolRevision
- the protocol version the server reported it supportspublic 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 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 void ensureAlive()
ensureAlive
in interface FlushableOutgoingEntryReceiver