Click or drag to resize
Akka.NETTcpExtBindAndHandle Method
Creates a TcpServerBinding instance which represents a prospective TCP server binding on the given host and port/> handling the incoming connections using the provided Flow.

Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing RunnableGraphTMat the server is not immediately available. Only after the materialized future completes is the server ready to accept client connections.

Namespace:  Akka.Streams.Dsl
Assembly:  Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
public Task<TcpServerBinding> BindAndHandle(
	Flow<ByteString, ByteString, NotUsed> handler,
	IMaterializer materializer,
	string host,
	int port,
	int backlog = 100,
	IImmutableList<InetSocketOption> options = null,
	bool halfClose = false,
	Nullable<TimeSpan> idleTimeout = null
)

Parameters

handler
Type: Akka.Streams.DslFlowByteString, ByteString, NotUsed
A Flow that represents the server logic
materializer
Type: Akka.StreamsIMaterializer
TBD
host
Type: SystemString
The host to listen on
port
Type: SystemInt32
The port to listen on
backlog (Optional)
Type: SystemInt32
Controls the size of the connection backlog
options (Optional)
Type: IImmutableListInetSocketOption
TCP options for the connections, see Tcp for details
halfClose (Optional)
Type: SystemBoolean
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.
idleTimeout (Optional)
Type: SystemNullableTimeSpan
TBD

Return Value

Type: TaskTcpServerBinding
TBD
See Also