Package org.nustaq.kontraktor.asyncio
Class AsyncServerSocket
java.lang.Object
org.nustaq.kontraktor.asyncio.AsyncServerSocket
- Direct Known Subclasses:
NIOServerConnector
public class AsyncServerSocket
extends java.lang.Object
Created by ruedi on 04/05/15.
Implements NIO based TCP server
-
Constructor Summary
Constructors Constructor Description AsyncServerSocket()
-
Method Summary
Modifier and Type Method Description void
close()
void
connect(int port, java.util.function.BiFunction<java.nio.channels.SelectionKey,java.nio.channels.SocketChannel,AsyncSocketConnection> connectionFactory)
boolean
isClosed()
void
receiveLoop()
-
Constructor Details
-
AsyncServerSocket
public AsyncServerSocket()
-
-
Method Details
-
connect
public void connect(int port, java.util.function.BiFunction<java.nio.channels.SelectionKey,java.nio.channels.SocketChannel,AsyncSocketConnection> connectionFactory) throws java.io.IOException- Throws:
java.io.IOException
-
receiveLoop
public void receiveLoop() -
isClosed
public boolean isClosed() -
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-