|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.network.kernel.AbstractKernel
com.jme3.network.kernel.tcp.SelectorKernel
public class SelectorKernel
A Kernel implementation based on NIO selectors.
Nested Class Summary | |
---|---|
protected class |
SelectorKernel.SelectorThread
This class is purposely tucked neatly away because messing with the selector from other threads for any reason is very bad. |
Field Summary |
---|
Fields inherited from interface com.jme3.network.kernel.Kernel |
---|
EVENTS_PENDING |
Constructor Summary | |
---|---|
SelectorKernel(java.net.InetAddress host,
int port)
|
|
SelectorKernel(java.net.InetSocketAddress address)
|
|
SelectorKernel(int port)
|
Method Summary | |
---|---|
protected NioEndpoint |
addEndpoint(java.nio.channels.SocketChannel c)
|
void |
broadcast(Filter<? super Endpoint> filter,
java.nio.ByteBuffer data,
boolean reliable,
boolean copy)
Dispatches the data to all endpoints managed by the kernel that match the specified endpoint filter.. |
protected void |
closeEndpoint(NioEndpoint p)
Called by the endpoints when they need to be closed. |
protected SelectorKernel.SelectorThread |
createSelectorThread()
|
void |
initialize()
Initializes the kernel and starts any internal processing. |
protected void |
newData(NioEndpoint p,
java.nio.channels.SocketChannel c,
java.nio.ByteBuffer shared,
int size)
|
protected void |
removeEndpoint(NioEndpoint p,
java.nio.channels.SocketChannel c)
|
void |
terminate()
Gracefully terminates the kernel and stops any internal daemon processing. |
protected void |
wakeupSelector()
Used internally by the endpoints to wakeup the selector when they have data to send. |
Methods inherited from class com.jme3.network.kernel.AbstractKernel |
---|
addEnvelope, addEvent, hasEnvelopes, nextEndpointId, nextEvent, read, reportError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectorKernel(java.net.InetAddress host, int port)
public SelectorKernel(int port) throws java.io.IOException
java.io.IOException
public SelectorKernel(java.net.InetSocketAddress address)
Method Detail |
---|
protected SelectorKernel.SelectorThread createSelectorThread()
public void initialize()
Kernel
public void terminate() throws java.lang.InterruptedException
Kernel
java.lang.InterruptedException
public void broadcast(Filter<? super Endpoint> filter, java.nio.ByteBuffer data, boolean reliable, boolean copy)
Kernel
protected NioEndpoint addEndpoint(java.nio.channels.SocketChannel c)
protected void removeEndpoint(NioEndpoint p, java.nio.channels.SocketChannel c)
protected void closeEndpoint(NioEndpoint p) throws java.io.IOException
java.io.IOException
protected void wakeupSelector()
protected void newData(NioEndpoint p, java.nio.channels.SocketChannel c, java.nio.ByteBuffer shared, int size)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |