Class Tcp.Write
Write data to the TCP connection. If no ack is needed use the special
NoAck object. The connection actor will reply with a Tcp.CommandFailed
message if the write could not be enqueued. If Write.WantsAck
returns true, the connection actor will reply with the supplied Ack
token once the write has been successfully enqueued to the O/S kernel.
Note that this does not in any way guarantee that the data will be
or have been sent! Unfortunately there is no way to determine whether
a particular write has been sent by the O/S.
Implements
Inherited Members
Namespace: Akka.IO
Assembly: Akka.dll
Syntax
public sealed class Tcp.Write : Tcp.SimpleWriteCommand, INoSerializationVerificationNeeded
Fields
| Edit this page View SourceEmpty
Write with no data and Tcp.NoAck
Declaration
public static readonly Tcp.Write Empty
Field Value
| Type | Description |
|---|---|
| Tcp.Write |
Properties
| Edit this page View SourceAck
The optional acknowledgment event which will be sent to the sender of this command.
Declaration
public override Tcp.Event Ack { get; }
Property Value
| Type | Description |
|---|---|
| Tcp.Event |
Overrides
| Edit this page View SourceBytes
The number of bytes that will be written to the socket.
Declaration
public override long Bytes { get; }
Property Value
| Type | Description |
|---|---|
| long |
Overrides
| Edit this page View SourceData
The data we are going to write.
Declaration
public ReadOnlySequence<byte> Data { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlySequence<byte> |
Methods
| Edit this page View SourceCreate(ReadOnlySequence<byte>)
Creates a write from a ReadOnlySequence<T> of bytes.
Declaration
public static Tcp.Write Create(ReadOnlySequence<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySequence<byte> | data | The data to write. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
Create(ReadOnlySequence<byte>, Event)
Creates a write from a ReadOnlySequence<T> of bytes.
Declaration
public static Tcp.Write Create(ReadOnlySequence<byte> data, Tcp.Event ack)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySequence<byte> | data | The data to write. |
| Tcp.Event | ack | The acknowledgement message we'll receive once this write is complete. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
Create(byte[])
Creates a write from a byte array.
Declaration
public static Tcp.Write Create(byte[] data)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data to write. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
Create(byte[], Event)
Creates a write from a byte array.
Declaration
public static Tcp.Write Create(byte[] data, Tcp.Event ack)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | data | The data to write. |
| Tcp.Event | ack | The acknowledgement message we'll receive once this write is complete. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
Create(ReadOnlyMemory<byte>)
Creates a write from a ReadOnlyMemory<T> of bytes.
Declaration
public static Tcp.Write Create(ReadOnlyMemory<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyMemory<byte> | data | The data to write. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
Create(ReadOnlyMemory<byte>, Event)
Creates a write from a ReadOnlyMemory<T> of bytes.
Declaration
public static Tcp.Write Create(ReadOnlyMemory<byte> data, Tcp.Event ack)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlyMemory<byte> | data | The data to write. |
| Tcp.Event | ack | The acknowledgement message we'll receive once this write is complete. |
Returns
| Type | Description |
|---|---|
| Tcp.Write |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Edit this page