public class SingleConnectionManager extends java.lang.Object implements ConnectionManager
Connection into the provided receiveByteBuffer.
Handles writing bytes to a Connection from the provided sendByteBuffer.
The sendByteBuffer and receiveByteBuffer are shared the other classes that do tha actual reading/writing of SBE messages to/from
the buffers.| Constructor and Description |
|---|
SingleConnectionManager(java.lang.String host,
int port,
java.lang.String id,
java.time.Clock clock,
Connection connection,
BackPressureNotificationHandler backPressureNotificationHandler,
java.nio.ByteBuffer sendByteBuffer,
java.nio.ByteBuffer receiveByteBuffer)
Construct
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Attempts to connect to the configured server by host and port.
|
void |
disconnect() |
java.lang.String |
getId() |
long |
getLastReceivedMessageTimestampMs() |
long |
getLastSentMessageTimestampMs() |
void |
read() |
int |
send(int byteCount) |
java.lang.String |
toString() |
void |
writePendingBytes() |
public SingleConnectionManager(java.lang.String host,
int port,
java.lang.String id,
java.time.Clock clock,
Connection connection,
BackPressureNotificationHandler backPressureNotificationHandler,
java.nio.ByteBuffer sendByteBuffer,
java.nio.ByteBuffer receiveByteBuffer)
host - host to connect toport - port to connect toid - descriptive session identifierclock - clockconnection - connection to usebackPressureNotificationHandler - handler tosendByteBuffer - buffer to send data withreceiveByteBuffer - buffer to receive data withpublic void connect()
ConnectionManagerconnect in interface ConnectionManagerpublic void disconnect()
disconnect in interface ConnectionManagerpublic java.lang.String getId()
getId in interface ConnectionManagerpublic void writePendingBytes()
writePendingBytes in interface ConnectionManagerpublic void read()
throws MFDisconnectedException
read in interface ConnectionManagerMFDisconnectedExceptionpublic long getLastReceivedMessageTimestampMs()
getLastReceivedMessageTimestampMs in interface ConnectionManagerpublic long getLastSentMessageTimestampMs()
getLastSentMessageTimestampMs in interface ConnectionManagerpublic int send(int byteCount)
send in interface ConnectionManagerpublic java.lang.String toString()
toString in class java.lang.Object