RemoteConnectorpublic class SocketBasedConnector extends StreamRemoteConnector
StreamRemoteConnector.StreamStateexecutor, logger, START_OF_MSG, state| Constructor | Description |
|---|---|
SocketBasedConnector(ScheduledExecutorService executor,
MenuCommandProtocol protocol,
String remoteHost,
int remotePort) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Force close a connection when its known to be bad, the connector will try and
establish a new connection.
|
protected void |
getAtLeastBytes(ByteBuffer inputBuffer,
int len) |
Reads at least the number of bytes requested waiting if need be for more data.
|
String |
getConnectionName() |
Gets the name of this connector locally
|
protected void |
sendInternal(ByteBuffer outputBuffer) |
performs a send of all bytes in the output buffer until the output buffer is empty
|
void |
start() |
Starts the communication channel, so it will attempt to connect with the configured device
|
void |
stop() |
Stops the library and attempts to also stop any threads and other resources associated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoesBufferHaveEOM, isConnected, logByteBuffer, notifyConnection, processMessagesOnConnection, readCompleteMessage, registerConnectionChangeListener, registerConnectorListener, sendMenuCommandpublic SocketBasedConnector(ScheduledExecutorService executor, MenuCommandProtocol protocol, String remoteHost, int remotePort)
public void start()
RemoteConnectorpublic void stop()
RemoteConnectorprotected void getAtLeastBytes(ByteBuffer inputBuffer, int len) throws IOException
StreamRemoteConnectorgetAtLeastBytes in class StreamRemoteConnectorinputBuffer - the buffer to read fromlen - the minimum number of bytes neededIOException - if there are problems reading.protected void sendInternal(ByteBuffer outputBuffer) throws IOException
StreamRemoteConnectorsendInternal in class StreamRemoteConnectoroutputBuffer - the buffer data to be sentIOException - if there are problems writingpublic String getConnectionName()
RemoteConnectorpublic void close()
RemoteConnectorclose in interface RemoteConnectorclose in class StreamRemoteConnectorCopyright © 2018. All rights reserved.