Modifier and Type | Class and Description |
---|---|
static class |
Tcp.IncomingConnection
Represents an accepted incoming TCP connection.
|
static class |
Tcp.IncomingConnection$ |
static class |
Tcp.OutgoingConnection
Represents a prospective outgoing TCP connection.
|
static class |
Tcp.OutgoingConnection$ |
static class |
Tcp.ServerBinding
* Represents a successful TCP server binding.
|
static class |
Tcp.ServerBinding$ |
Constructor and Description |
---|
Tcp(ExtendedActorSystem system) |
Modifier and Type | Method and Description |
---|---|
static Tcp |
apply(ActorSystem system) |
Source<Tcp.IncomingConnection,scala.concurrent.Future<Tcp.ServerBinding>> |
bind(java.lang.String interface_,
int port,
int backlog,
scala.collection.immutable.Traversable<Inet.SocketOption> options,
boolean halfClose,
scala.concurrent.duration.Duration idleTimeout)
Creates a
Tcp.ServerBinding instance which represents a prospective TCP server binding on the given endpoint . |
scala.concurrent.Future<Tcp.ServerBinding> |
bindAndHandle(Flow<ByteString,ByteString,?> handler,
java.lang.String interface_,
int port,
int backlog,
scala.collection.immutable.Traversable<Inet.SocketOption> options,
boolean halfClose,
scala.concurrent.duration.Duration idleTimeout,
Materializer m)
Creates a
Tcp.ServerBinding instance which represents a prospective TCP server binding on the given endpoint
handling the incoming connections using the provided Flow. |
scala.concurrent.duration.FiniteDuration |
bindShutdownTimeout() |
static Tcp |
createExtension(ExtendedActorSystem system) |
static Tcp |
get(ActorSystem system) |
static Tcp$ |
lookup() |
Flow<ByteString,ByteString,scala.concurrent.Future<Tcp.OutgoingConnection>> |
outgoingConnection(java.net.InetSocketAddress remoteAddress,
scala.Option<java.net.InetSocketAddress> localAddress,
scala.collection.immutable.Traversable<Inet.SocketOption> options,
boolean halfClose,
scala.concurrent.duration.Duration connectTimeout,
scala.concurrent.duration.Duration idleTimeout)
Creates an
Tcp.OutgoingConnection instance representing a prospective TCP client connection to the given endpoint. |
Flow<ByteString,ByteString,scala.concurrent.Future<Tcp.OutgoingConnection>> |
outgoingConnection(java.lang.String host,
int port)
Creates an
Tcp.OutgoingConnection without specifying options. |
public Tcp(ExtendedActorSystem system)
public static Tcp apply(ActorSystem system)
public static Tcp get(ActorSystem system)
public static Tcp$ lookup()
public static Tcp createExtension(ExtendedActorSystem system)
public scala.concurrent.duration.FiniteDuration bindShutdownTimeout()
public Source<Tcp.IncomingConnection,scala.concurrent.Future<Tcp.ServerBinding>> bind(java.lang.String interface_, int port, int backlog, scala.collection.immutable.Traversable<Inet.SocketOption> options, boolean halfClose, scala.concurrent.duration.Duration idleTimeout)
Tcp.ServerBinding
instance which represents a prospective TCP server binding on the given endpoint
.
Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing
RunnableGraph
the server is not immediately available. Only after the materialized future
completes is the server ready to accept client connections.
interface
- The interface to listen onport
- The port to listen onbacklog
- Controls the size of the connection backlogoptions
- TCP options for the connections, see Tcp
for detailshalfClose
- Controls whether the connection is kept open even after writing has been completed to the accepted
TCP connections.
If set to true, the connection will implement the TCP half-close mechanism, allowing the client to
write to the connection even after the server has finished writing. The TCP socket is only closed
after both the client and server finished writing.
If set to false, the connection will immediately closed once the server closes its write side,
independently whether the client is still attempting to write. This setting is recommended
for servers, and therefore it is the default setting.interface_
- (undocumented)idleTimeout
- (undocumented)public scala.concurrent.Future<Tcp.ServerBinding> bindAndHandle(Flow<ByteString,ByteString,?> handler, java.lang.String interface_, int port, int backlog, scala.collection.immutable.Traversable<Inet.SocketOption> options, boolean halfClose, scala.concurrent.duration.Duration idleTimeout, Materializer m)
Tcp.ServerBinding
instance which represents a prospective TCP server binding on the given endpoint
handling the incoming connections using the provided Flow.
Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing
RunnableGraph
the server is not immediately available. Only after the returned future
completes is the server ready to accept client connections.
handler
- A Flow that represents the server logicinterface
- The interface to listen onport
- The port to listen onbacklog
- Controls the size of the connection backlogoptions
- TCP options for the connections, see Tcp
for detailshalfClose
- Controls whether the connection is kept open even after writing has been completed to the accepted
TCP connections.
If set to true, the connection will implement the TCP half-close mechanism, allowing the client to
write to the connection even after the server has finished writing. The TCP socket is only closed
after both the client and server finished writing.
If set to false, the connection will immediately closed once the server closes its write side,
independently whether the client is still attempting to write. This setting is recommended
for servers, and therefore it is the default setting.interface_
- (undocumented)idleTimeout
- (undocumented)m
- (undocumented)public Flow<ByteString,ByteString,scala.concurrent.Future<Tcp.OutgoingConnection>> outgoingConnection(java.net.InetSocketAddress remoteAddress, scala.Option<java.net.InetSocketAddress> localAddress, scala.collection.immutable.Traversable<Inet.SocketOption> options, boolean halfClose, scala.concurrent.duration.Duration connectTimeout, scala.concurrent.duration.Duration idleTimeout)
Tcp.OutgoingConnection
instance representing a prospective TCP client connection to the given endpoint.
remoteAddress
- The remote address to connect tolocalAddress
- Optional local address for the connectionoptions
- TCP options for the connections, see Tcp
for detailshalfClose
- Controls whether the connection is kept open even after writing has been completed to the accepted
TCP connections.
If set to true, the connection will implement the TCP half-close mechanism, allowing the server to
write to the connection even after the client has finished writing. The TCP socket is only closed
after both the client and server finished writing. This setting is recommended for clients and
therefore it is the default setting.
If set to false, the connection will immediately closed once the client closes its write side,
independently whether the server is still attempting to write.connectTimeout
- (undocumented)idleTimeout
- (undocumented)public Flow<ByteString,ByteString,scala.concurrent.Future<Tcp.OutgoingConnection>> outgoingConnection(java.lang.String host, int port)
Tcp.OutgoingConnection
without specifying options.
It represents a prospective TCP client connection to the given endpoint.host
- (undocumented)port
- (undocumented)