public class ServerConnection extends CrtResource
CrtResource.ResourceInstance| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canReleaseReferencesImmediately()
Override that determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.
|
void |
closeConnection(int shutdownError)
Closes the connection with shutdownError
|
CompletableFuture<Integer> |
getClosedFuture() |
boolean |
isConnectionOpen() |
protected void |
releaseNativeHandle()
Required override method that must begin the release process of the acquired native handle
|
CompletableFuture<Void> |
sendProtocolMessage(List<Header> headers,
byte[] payload,
MessageType messsageType,
int messageFlags)
Sends a protocol message on the connection.
|
void |
sendProtocolMessage(List<Header> headers,
byte[] payload,
MessageType messsageType,
int messageFlags,
MessageFlushCallback callback)
Sends a protocol message on the connection.
|
acquireNativeHandle, addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, releaseReferences, removeReferenceTo, setDescription, swapReferenceTo, waitForNoResourcespublic boolean isConnectionOpen()
public void closeConnection(int shutdownError)
shutdownError - error code to shutdown the connection with. If
shutting down cleanly, use 0.public CompletableFuture<Void> sendProtocolMessage(List<Header> headers, byte[] payload, MessageType messsageType, int messageFlags)
headers - List of event-stream headers. Can be null.payload - Payload to send for the message. Can be null.messsageType - Message type for the rpc message.messageFlags - Union of message flags from MessageFlags.getByteValue()public void sendProtocolMessage(List<Header> headers, byte[] payload, MessageType messsageType, int messageFlags, MessageFlushCallback callback)
headers - List of event-stream headers. Can be null.payload - Payload to send for the message. Can be null.messsageType - Message type for the rpc message.messageFlags - Union of message flags from MessageFlags.getByteValue()callback - invoked upon the message flushing to the underlying transport.public CompletableFuture<Integer> getClosedFuture()
protected void releaseNativeHandle()
CrtResourcereleaseNativeHandle in class CrtResourceprotected boolean canReleaseReferencesImmediately()
CrtResourcecanReleaseReferencesImmediately in class CrtResourceCopyright © 2021. All rights reserved.