IConnection

Description

interface Tinman.Core.IO.Sockets.IConnection

Derived from

IDisposable

Base interface for network connections.

Network connections provided by IConnection implementations are connection oriented and reliable.

Public / Methods

Receive


public method Receive → (1)

buffer in : ByteBuffer

[not-null]
The byte buffer where to store the received bytes.

returns → bool

true if all requested bytes have been received, false if the socket has been closed (via IDisposable.Dispose).

Receives a sequence of bytes from this network connection.

The number of bytes to receive is the number of ByteBuffer.Remaining bytes in the given ByteBuffer. The received bytes will be written to the buffer beginning at its current ByteBuffer.Position.

IOException

If an I/O error has occurred.

Send


public method Send → (1)

buffer in : ByteBuffer

[not-null]
The byte buffer that holds the bytes to send.

returns → bool

true if the data has been sent successfully, false if the socket has been closed (via IDisposable.Dispose).

Sends a sequence of bytes over this network connection.

The ByteBuffer.Position and ByteBuffer.Limit of the given ByteBuffer depict the range of bytes in the buffer that will be sent.

IOException

If an I/O error has occurred.

Public / Attributes

End​Point


public attribute EndPoint → (get)

value : IEndPoint

[not-null]
The network endpoint address.

Returns the network endpoint address of this connections the remote endpoint.