Package com.jme3.network.kernel.tcp
Class NioEndpoint
java.lang.Object
com.jme3.network.kernel.tcp.NioEndpoint
- All Implemented Interfaces:
Endpoint
Endpoint implementation that encapsulates the
channel IO based connection information and keeps
track of the outbound data queue for the channel.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this endpoint without flushing any of its currently enqueued outbound data.void
close
(boolean flushData) Closes this endpoint, optionally flushing any queued data before closing.Returns the transport specific remote address of this endpoint as a string.long
getId()
Returns an ID that is unique for this endpoint within its Kernel instance.Returns the kernel to which this endpoint belongs.protected boolean
boolean
Returns true if this endpoint is currently connected.protected ByteBuffer
Called by the SelectorKernel to get the current top buffer for writing.protected ByteBuffer
Called by the SelectorKernel when the top buffer has been exhausted.void
send
(ByteBuffer data) Sends data to the other end of the connection represented by this endpoint.protected void
send
(ByteBuffer data, boolean copy, boolean wakeup) The wakeup option is used internally when the kernel is broadcasting out to a bunch of endpoints and doesn't want to necessarily wakeup right away.toString()
-
Field Details
-
CLOSE_MARKER
-
-
Constructor Details
-
NioEndpoint
-
-
Method Details
-
getKernel
Description copied from interface:Endpoint
Returns the kernel to which this endpoint belongs. -
close
public void close()Description copied from interface:Endpoint
Closes this endpoint without flushing any of its currently enqueued outbound data. -
close
public void close(boolean flushData) Description copied from interface:Endpoint
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. -
getId
public long getId()Description copied from interface:Endpoint
Returns an ID that is unique for this endpoint within its Kernel instance. -
getAddress
Description copied from interface:Endpoint
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.- Specified by:
getAddress
in interfaceEndpoint
-
isConnected
public boolean isConnected()Description copied from interface:Endpoint
Returns true if this endpoint is currently connected.- Specified by:
isConnected
in interfaceEndpoint
-
send
The wakeup option is used internally when the kernel is broadcasting out to a bunch of endpoints and doesn't want to necessarily wakeup right away. -
peekPending
Called by the SelectorKernel to get the current top buffer for writing. -
removePending
Called by the SelectorKernel when the top buffer has been exhausted. -
hasPending
protected boolean hasPending() -
send
Description copied from interface:Endpoint
Sends data to the other end of the connection represented by this endpoint. -
toString
-