Class TcpSettings
Settings for Akka.IO.Tcp's outbound and inbound connection acvtors.
Implements
Inherited Members
Namespace: Akka.IO
Assembly: Akka.dll
Syntax
public sealed record TcpSettings : IEquatable<TcpSettings>
Constructors
| Edit this page View SourceTcpSettings(string, int, bool, int, TimeSpan?, int, string, string, int, int, bool, int)
Declaration
[Obsolete("Many of these options are no longer used. Use the TcpSettings.Create method instead.")]
public TcpSettings(string bufferPoolConfigPath, int initialSocketAsyncEventArgs, bool traceLogging, int batchAcceptLimit, TimeSpan? registerTimeout, int receivedMessageSizeLimit, string managementDispatcher, string fileIoDispatcher, int transferToLimit, int finishConnectRetries, bool outgoingSocketForceIpv4, int writeCommandsQueueMaxSize)
Parameters
Type | Name | Description |
---|---|---|
string | bufferPoolConfigPath | |
int | initialSocketAsyncEventArgs | |
bool | traceLogging | |
int | batchAcceptLimit | |
TimeSpan? | registerTimeout | |
int | receivedMessageSizeLimit | |
string | managementDispatcher | |
string | fileIoDispatcher | |
int | transferToLimit | |
int | finishConnectRetries | |
bool | outgoingSocketForceIpv4 | |
int | writeCommandsQueueMaxSize |
Properties
| Edit this page View SourceBatchAcceptLimit
The maximum number of connection that are accepted in one go, higher numbers decrease latency, lower numbers increase fairness on the worker-dispatcher
Declaration
public int BatchAcceptLimit { get; init; }
Property Value
Type | Description |
---|---|
int |
BufferPoolConfigPath
A config path to the section defining which byte buffer pool to use. Buffer pools are used to mitigate GC-pressure made by potential allocation and deallocation of byte buffers used for writing/receiving data from sockets.
Declaration
[Obsolete("This property is unused")]
public string BufferPoolConfigPath { get; }
Property Value
Type | Description |
---|---|
string |
FileIODispatcher
Fully qualified config path which holds the dispatcher configuration on which file IO tasks are scheduled
Declaration
[Obsolete("This property is unused")]
public string FileIODispatcher { get; }
Property Value
Type | Description |
---|---|
string |
FinishConnectRetries
The number of times to retry the finishConnect
call after being notified about
OP_CONNECT. Retries are needed if the OP_CONNECT notification doesn't imply that
finishConnect
will succeed, which is the case on Android.
Declaration
public int FinishConnectRetries { get; init; }
Property Value
Type | Description |
---|---|
int |
InitialSocketAsyncEventArgs
The initial number of SocketAsyncEventArgs to be preallocated. This value will grow infinitely if needed.
Declaration
[Obsolete("This property is unused")]
public int InitialSocketAsyncEventArgs { get; }
Property Value
Type | Description |
---|---|
int |
ManagementDispatcher
Fully qualified config path which holds the dispatcher configuration for the selector management actors
Declaration
public string ManagementDispatcher { get; }
Property Value
Type | Description |
---|---|
string |
MaxFrameSizeBytes
The maximum frame size we will accept when reading or writing to a socket.
Declaration
public int MaxFrameSizeBytes { get; init; }
Property Value
Type | Description |
---|---|
int |
OutgoingSocketForceIpv4
Enforce outgoing socket connection to use IPv4 address family. Required in a scenario when IPv6 is not available, for example in Azure Web App sandbox. When set to true it is required to set akka.io.dns.inet-address.use-ipv6 to false in cases when DnsEndPoint is used to describe the remote address
Declaration
public bool OutgoingSocketForceIpv4 { get; init; }
Property Value
Type | Description |
---|---|
bool |
ReceiveBufferSize
Should be at least 2x the size of the maximum frame size.
Declaration
public int ReceiveBufferSize { get; init; }
Property Value
Type | Description |
---|---|
int |
ReceivedMessageSizeLimit
The maximum number of bytes delivered by a Received
message. Before
more data is read from the network the connection actor will try to
do other work.
The purpose of this setting is to impose a smaller limit than the
configured receive buffer size. When using value 'unlimited' it will
try to read all from the receive buffer.
Declaration
[Obsolete("This property is now MaxFrameSizeBytes")]
public long ReceivedMessageSizeLimit { get; }
Property Value
Type | Description |
---|---|
long |
RegisterTimeout
The duration a connection actor waits for a Register
message from
its commander before aborting the connection.
Declaration
public TimeSpan? RegisterTimeout { get; init; }
Property Value
Type | Description |
---|---|
TimeSpan? |
SendBufferSize
Should be at least 2x the size of the maximum frame size.
Declaration
public int SendBufferSize { get; init; }
Property Value
Type | Description |
---|---|
int |
TraceLogging
Enable fine grained logging of what goes on inside the implementation. Be aware that this may log more than once per message sent to the actors of the tcp implementation.
Declaration
public bool TraceLogging { get; init; }
Property Value
Type | Description |
---|---|
bool |
TransferToLimit
The maximum number of bytes (or "unlimited") to transfer in one batch
when using WriteFile
command which uses FileChannel.transferTo
to
pipe files to a TCP socket. On some OS like Linux FileChannel.transferTo
may block for a long time when network IO is faster than file IO.
Decreasing the value may improve fairness while increasing may improve
throughput.
Declaration
[Obsolete("This property is unused")]
public int TransferToLimit { get; set; }
Property Value
Type | Description |
---|---|
int |
WriteCommandsQueueMaxSize
Limits maximum size of internal queue, used in Akka.IO.TcpIncomingConnection connection actor to store pending write commands. To allow unlimited size, set to -1.
Declaration
public int WriteCommandsQueueMaxSize { get; init; }
Property Value
Type | Description |
---|---|
int |
Remarks
This setting defines the maximum number of messages, not the maximum size in bytes.
Methods
| Edit this page View SourceCreate(ActorSystem)
Creates a new instance of TcpSettings class
and fills it with values parsed from akka.io.tcp
HOCON
path found in actor system.
Declaration
public static TcpSettings Create(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system |
Returns
Type | Description |
---|---|
TcpSettings |
Create(Config)
Creates a new instance of TcpSettings class and fills it with values parsed from provided HOCON config.
Declaration
public static TcpSettings Create(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The HOCON path that contains the |
Returns
Type | Description |
---|---|
TcpSettings |