|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.actor.IOManager
public final class IOManager
IOManager contains a reference to the IOManagerActor
for
an ActorSystem
.
This is the recommended entry point to creating sockets for performing IO.
Use the companion object to retrieve the instance of this class for an ActorSystem.
val ioManager = IOManager(context.system)
val socket = ioManager.connect("127.0.0.1")
An IOManager does not need to be manually stopped when not in use as it will automatically enter an idle state when it has no channels to manage.
Nested Class Summary | |
---|---|
static class |
IOManager.Settings
|
static class |
IOManager.Settings$
|
Method Summary | |
---|---|
ActorRef |
actor()
A reference to the IOManagerActor that performs the actual
IO. |
IO.SocketHandle |
connect(java.net.SocketAddress address,
scala.collection.immutable.Seq<IO.SocketOption> options,
ActorRef owner)
Create a SocketChannel connecting to an address. |
IO.SocketHandle |
connect(java.lang.String host,
int port,
ActorRef owner)
Create a SocketChannel connecting to a host and port. |
static IOManager |
createExtension(ExtendedActorSystem system)
|
IO.ServerHandle |
listen(java.net.SocketAddress address,
ActorRef owner)
Create a ServerSocketChannel listening on an address. |
IO.ServerHandle |
listen(java.net.SocketAddress address,
scala.collection.immutable.Seq<IO.ServerSocketOption> options,
ActorRef owner)
Create a ServerSocketChannel listening on an address. |
IO.ServerHandle |
listen(java.lang.String host,
int port,
scala.collection.immutable.Seq<IO.ServerSocketOption> options,
ActorRef owner)
Create a ServerSocketChannel listening on a host and port. |
static IOManager$ |
lookup()
|
IOManager.Settings |
settings()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static IOManager$ lookup()
public static IOManager createExtension(ExtendedActorSystem system)
public IOManager.Settings settings()
public ActorRef actor()
IOManagerActor
that performs the actual
IO. It communicates with other actors using subclasses of
IO.IOMessage
.
public IO.ServerHandle listen(java.net.SocketAddress address, scala.collection.immutable.Seq<IO.ServerSocketOption> options, ActorRef owner)
IOManagerActor
to the owner
ActorRef
.
address
- the address to listen onowner
- the ActorRef that will receive messages from the IOManagerActoroption
- Seq of akka.actor.IO.ServerSocketOptions
to setup on socket
IO.ServerHandle
to uniquely identify the created socketpublic IO.ServerHandle listen(java.net.SocketAddress address, ActorRef owner)
IOManagerActor
to the owner
ActorRef
.
address
- the address to listen onowner
- the ActorRef that will receive messages from the IOManagerActor
IO.ServerHandle
to uniquely identify the created socketpublic IO.ServerHandle listen(java.lang.String host, int port, scala.collection.immutable.Seq<IO.ServerSocketOption> options, ActorRef owner)
IOManagerActor
to the owner
ActorRef
.
host
- the hostname or IP to listen onport
- the port to listen onoptions
- Seq of IO.ServerSocketOption
to setup on socketowner
- the ActorRef that will receive messages from the IOManagerActor
IO.ServerHandle
to uniquely identify the created socketpublic IO.SocketHandle connect(java.net.SocketAddress address, scala.collection.immutable.Seq<IO.SocketOption> options, ActorRef owner)
IOManagerActor
to the owner
ActorRef
.
address
- the address to connect tooptions
- Seq of IO.SocketOption
to setup on established socketowner
- the ActorRef that will receive messages from the IOManagerActor
IO.SocketHandle
to uniquely identify the created socketpublic IO.SocketHandle connect(java.lang.String host, int port, ActorRef owner)
IOManagerActor
to the owner
ActorRef
.
host
- the hostname or IP to connect toport
- the port to connect tooptions
- Seq of IO.SocketOption
to setup on established socketowner
- the ActorRef that will receive messages from the IOManagerActor
IO.SocketHandle
to uniquely identify the created socket
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |