Search Results for

    Show / Hide Table of Contents

    Class TcpExt

    TBD

    Inheritance
    object
    TcpExt
    Implements
    IExtension
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.Dsl
    Assembly: Akka.Streams.dll
    Syntax
    public class TcpExt : IExtension

    Fields

    | Edit this page View Source

    BindShutdownTimeout

    TBD

    Declaration
    protected readonly TimeSpan BindShutdownTimeout
    Field Value
    Type Description
    TimeSpan

    Methods

    | Edit this page View Source

    Bind(string, int, int, IImmutableList<SocketOption>, bool, TimeSpan?)

    Creates a Tcp.ServerBinding instance which represents a prospective TCP server binding on the given host and port/>.

    Please note that the startup of the server is asynchronous, i.e. after materializing the enclosing RunnableGraph<TMat> the server is not immediately available. Only after the materialized future completes is the server ready to accept client connections.
    Declaration
    public Source<Tcp.IncomingConnection, Task<Tcp.ServerBinding>> Bind(string host, int port, int backlog = 100, IImmutableList<Inet.SocketOption> options = null, bool halfClose = false, TimeSpan? idleTimeout = null)
    Parameters
    Type Name Description
    string host

    The host to listen on

    int port

    The port to listen on

    int backlog

    Controls the size of the connection backlog

    IImmutableList<Inet.SocketOption> options

    TCP options for the connections, see Tcp for details

    bool halfClose

    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.

    TimeSpan? idleTimeout

    TBD

    Returns
    Type Description
    Source<Tcp.IncomingConnection, Task<Tcp.ServerBinding>>

    TBD

    Exceptions
    Type Condition
    ArgumentException

    TBD

    | Edit this page View Source

    BindAndHandle(Flow<ByteString, ByteString, NotUsed>, IMaterializer, string, int, int, IImmutableList<SocketOption>, bool, TimeSpan?)

    Creates a Tcp.ServerBinding 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 RunnableGraph<TMat> the server is not immediately available. Only after the materialized future completes is the server ready to accept client connections.
    Declaration
    public Task<Tcp.ServerBinding> BindAndHandle(Flow<ByteString, ByteString, NotUsed> handler, IMaterializer materializer, string host, int port, int backlog = 100, IImmutableList<Inet.SocketOption> options = null, bool halfClose = false, TimeSpan? idleTimeout = null)
    Parameters
    Type Name Description
    Flow<ByteString, ByteString, NotUsed> handler

    A Flow that represents the server logic

    IMaterializer materializer

    TBD

    string host

    The host to listen on

    int port

    The port to listen on

    int backlog

    Controls the size of the connection backlog

    IImmutableList<Inet.SocketOption> options

    TCP options for the connections, see Tcp for details

    bool halfClose

    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.

    TimeSpan? idleTimeout

    TBD

    Returns
    Type Description
    Task<Tcp.ServerBinding>

    TBD

    | Edit this page View Source

    OutgoingConnection(EndPoint, EndPoint, IImmutableList<SocketOption>, bool, TimeSpan?, TimeSpan?)

    Creates a Tcp.OutgoingConnection instance representing a prospective TCP client connection to the given endpoint.

    Note that the ByteString chunk boundaries are not retained across the network, to achieve application level chunks you have to introduce explicit framing in your streams, for example using the Framing stages.

    Declaration
    public Flow<ByteString, ByteString, Task<Tcp.OutgoingConnection>> OutgoingConnection(EndPoint remoteAddress, EndPoint localAddress = null, IImmutableList<Inet.SocketOption> options = null, bool halfClose = true, TimeSpan? connectionTimeout = null, TimeSpan? idleTimeout = null)
    Parameters
    Type Name Description
    EndPoint remoteAddress

    The remote address to connect to

    EndPoint localAddress

    Optional local address for the connection

    IImmutableList<Inet.SocketOption> options

    TCP options for the connections, see Tcp for details

    bool halfClose

    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.

    TimeSpan? connectionTimeout

    TBD

    TimeSpan? idleTimeout

    TBD

    Returns
    Type Description
    Flow<ByteString, ByteString, Task<Tcp.OutgoingConnection>>

    TBD

    | Edit this page View Source

    OutgoingConnection(string, int)

    Creates an Tcp.OutgoingConnection without specifying options. It represents a prospective TCP client connection to the given endpoint.

    Note that the ByteString chunk boundaries are not retained across the network, to achieve application level chunks you have to introduce explicit framing in your streams, for example using the Framing stages.

    Declaration
    public Flow<ByteString, ByteString, Task<Tcp.OutgoingConnection>> OutgoingConnection(string host, int port)
    Parameters
    Type Name Description
    string host

    TBD

    int port

    TBD

    Returns
    Type Description
    Flow<ByteString, ByteString, Task<Tcp.OutgoingConnection>>

    TBD

    Implements

    IExtension

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET