Interface Endpoint
- All Known Implementing Classes:
NioEndpoint, UdpEndpoint
public interface Endpoint
An abstract endpoint in a Kernel that can be used for
sending/receiving messages within the kernel space.
- Author:
- Paul Speed
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this endpoint without flushing any of its currently enqueued outbound data.voidclose(boolean flushData) Closes this endpoint, optionally flushing any queued data before closing.Returns the transport specific remote address of this endpoint as a string.longgetId()Returns an ID that is unique for this endpoint within its Kernel instance.Returns the kernel to which this endpoint belongs.booleanReturns true if this endpoint is currently connected.voidsend(ByteBuffer data) Sends data to the other end of the connection represented by this endpoint.
-
Method Details
-
getId
long getId()Returns an ID that is unique for this endpoint within its Kernel instance.- Returns:
- the endpoint id
-
getAddress
String getAddress()Returns the transport specific remote address of this endpoint as a string. This may or may not be unique per endpoint depending on the type of transport.- Returns:
- the remote address string
-
getKernel
-
isConnected
boolean isConnected()Returns true if this endpoint is currently connected.- Returns:
- true if the endpoint is connected
-
send
Sends data to the other end of the connection represented by this endpoint.- Parameters:
data- the bytes to send
-
close
void close()Closes this endpoint without flushing any of its currently enqueued outbound data. -
close
void close(boolean flushData) Closes this endpoint, optionally flushing any queued data before closing. As soon as this method is called, new send() calls will fail with an exception... even while close() is still flushing the earlier queued messages.- Parameters:
flushData- true to flush queued data before closing
-