Implementation Note
The first byte of every message identifies its type as a RemoteMessage.
Every message is terminated with '\0'.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| private final ObjectInputStream | |
| private static final Logger | |
| private final ObjectOutputStream | |
| private final Socket |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Protocol(Socket
the connection to communicate over; only its output stream is used socket, InputStream the stream to read requests from — a wrapper around the socket's input stream that supports non-destructive probing, restored to the start of the request inputStream)Creates a protocol using a previously inspected input stream. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this resource, relinquishing any underlying resources. |
| public Pair | |
| public void | |
| public void |
| IDENTIFIER | back to summary |
|---|---|
| public static final String IDENTIFIER | |
| in | back to summary |
|---|---|
| private final ObjectInputStream in | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| out | back to summary |
|---|---|
| private final ObjectOutputStream out | |
| socket | back to summary |
|---|---|
| private final Socket socket | |
| Protocol | back to summary |
|---|---|
| public Protocol(Socket socket) throws IOException | |
| Protocol | back to summary |
|---|---|
| public Protocol(Socket socket, InputStream inputStream) throws IOException Creates a protocol using a previously inspected input stream. The remote listener uses this overload after checking whether the connection is a plain-text health check rather than a serialized remote-operation request.
| |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| receiveMessage | back to summary |
|---|---|
| public Pair | |
| sendMessage | back to summary |
|---|---|
| public void sendMessage(RemoteMessage type) throws IOException | |
| sendMessage | back to summary |
|---|---|
| public void sendMessage(RemoteMessage type, Object argument) throws IOException | |