Class TCPClientConnector
java.lang.Object
org.nustaq.kontraktor.remoting.tcp.TCPClientConnector
- All Implemented Interfaces:
ActorClientConnector
public class TCPClientConnector extends java.lang.Object implements ActorClientConnector
Created by ruedi on 10/05/15.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTCPClientConnector.RemotingHelper -
Field Summary
Fields Modifier and Type Field Description protected Callback<ActorClientConnector>disconnectCallbackprotected java.lang.Stringhostprotected intportprotected static java.util.concurrent.atomic.AtomicReference<TCPClientConnector.RemotingHelper>singletonprotected org.nustaq.kontraktor.remoting.tcp.TCPClientConnector.MyTCPSocketsocketFields inherited from interface org.nustaq.kontraktor.remoting.base.ActorClientConnector
OBJECT_MAX_BATCH_SIZE -
Constructor Summary
Constructors Constructor Description TCPClientConnector(int port, java.lang.String host, Callback<ActorClientConnector> disconnectCallback) -
Method Summary
Modifier and Type Method Description IPromisecloseClient()IPromiseconnect(java.util.function.Function<ObjectSocket,ObjectSink> factory)protected static TCPClientConnector.RemotingHelperget()in case clients are connected from non actor world, provide a global actor(thread) for remote client processing (=polling queues, encoding)
-
Field Details
-
singleton
protected static java.util.concurrent.atomic.AtomicReference<TCPClientConnector.RemotingHelper> singleton -
port
protected int port -
host
protected java.lang.String host -
socket
protected org.nustaq.kontraktor.remoting.tcp.TCPClientConnector.MyTCPSocket socket -
disconnectCallback
-
-
Constructor Details
-
TCPClientConnector
public TCPClientConnector(int port, java.lang.String host, Callback<ActorClientConnector> disconnectCallback)
-
-
Method Details
-
get
in case clients are connected from non actor world, provide a global actor(thread) for remote client processing (=polling queues, encoding) -
connect
public IPromise connect(java.util.function.Function<ObjectSocket,ObjectSink> factory) throws java.lang.Exception- Specified by:
connectin interfaceActorClientConnector- Throws:
java.lang.Exception
-
closeClient
- Specified by:
closeClientin interfaceActorClientConnector
-