C# Класс WireBus.WireBusClient

A WireBus client, responsible for wrapping a TCP/IP connection and serializing the data going over the bus.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Connect ( IPAddress host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : WireBusClient

Connect to a peer, returning a new bus.

Connect ( string host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : WireBusClient

Connect to a peer, returning a new bus.

ConnectAsync ( IPAddress host, int port, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( IPAddress host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( IPAddress host, int port, System.TimeSpan timeout, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( IPAddress host, int port, System.TimeSpan timeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( IPAddress host, int port, int millisecondsTimeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( string host, int port, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( string host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( string host, int port, System.TimeSpan timeout, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( string host, int port, System.TimeSpan timeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

ConnectAsync ( string host, int port, int millisecondsTimeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task

Connect to a peer, returning a new bus.

Disconnect ( ) : void

Disconnect from the peer

Dispose ( ) : void

Dispose of the client

Receive ( ) : WireContext

Receive a message from the network

ReceiveAsync ( ) : Task

Receive a message from the network

ReceiveAsync ( CancellationToken token ) : Task

Receive a message from the network

ReceiveAsync ( System.TimeSpan timeout ) : Task

Receive a message from the network

ReceiveAsync ( System.TimeSpan timeout, CancellationToken token ) : Task

Receive a message from the network

ReceiveAsync ( int timeoutMilliseconds ) : Task

Receive a message from the network

Send ( byte message ) : void

Send a message to the peer.

SendAsync ( byte message ) : Task

Send a message to the peer.

SendRequest ( byte message ) : WireContext

Send a message to the peer and wait for a reply

SendRequestAsync ( byte message ) : Task

Send a message to the peer and wait for a reply

Приватные методы

Метод Описание
GetNextId ( ) : uint
InternalSendAsync ( byte message, uint id ) : Task
ReceiveMessages ( ) : void
SocketReceiveAsync ( Socket s, byte buffer, int start, int length ) : Task
WireBusClient ( Socket socket ) : System
WireBusClient ( Socket socket, ConnectionSemantics semantics ) : System

Описание методов

Connect() публичный статический Метод

Connect to a peer, returning a new bus.
public static Connect ( IPAddress host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : WireBusClient
host System.Net.IPAddress the target host
port int the target port
semantics ConnectionSemantics the semantics of the connection
Результат WireBusClient

Connect() публичный статический Метод

Connect to a peer, returning a new bus.
public static Connect ( string host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : WireBusClient
host string the target host
port int the target port
semantics ConnectionSemantics the semantics of the connection
Результат WireBusClient

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( IPAddress host, int port, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host System.Net.IPAddress the target host
port int the target port
token System.Threading.CancellationToken token used to cancel connection attempt
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( IPAddress host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host System.Net.IPAddress the target host
port int the target port
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( IPAddress host, int port, System.TimeSpan timeout, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host System.Net.IPAddress the target host
port int the target port
timeout System.TimeSpan the timeout after which to give up
token System.Threading.CancellationToken token used to cancel connection attempt
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( IPAddress host, int port, System.TimeSpan timeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host System.Net.IPAddress the target host
port int the target port
timeout System.TimeSpan the timeout after which to give up
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( IPAddress host, int port, int millisecondsTimeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host System.Net.IPAddress the target host
port int the target port
millisecondsTimeout int the timeout in milliseconds after which to give up
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( string host, int port, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host string the target host
port int the target port
token System.Threading.CancellationToken token used to cancel connection attempt
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( string host, int port, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host string the target host
port int the target port
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( string host, int port, System.TimeSpan timeout, CancellationToken token, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host string the target host
port int the target port
timeout System.TimeSpan the timeout after which to give up
token System.Threading.CancellationToken token used to cancel connection attempt
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( string host, int port, System.TimeSpan timeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host string the target host
port int the target port
timeout System.TimeSpan the timeout after which to give up
semantics ConnectionSemantics the semantics of the connection
Результат Task

ConnectAsync() публичный статический Метод

Connect to a peer, returning a new bus.
public static ConnectAsync ( string host, int port, int millisecondsTimeout, ConnectionSemantics semantics = newConnectionSemantics() ) : Task
host string the target host
port int the target port
millisecondsTimeout int the timeout in milliseconds after which to give up
semantics ConnectionSemantics the semantics of the connection
Результат Task

Disconnect() публичный Метод

Disconnect from the peer
public Disconnect ( ) : void
Результат void

Dispose() публичный Метод

Dispose of the client
public Dispose ( ) : void
Результат void

Receive() публичный Метод

Receive a message from the network
public Receive ( ) : WireContext
Результат WireContext

ReceiveAsync() публичный Метод

Receive a message from the network
public ReceiveAsync ( ) : Task
Результат Task

ReceiveAsync() публичный Метод

Receive a message from the network
public ReceiveAsync ( CancellationToken token ) : Task
token System.Threading.CancellationToken
Результат Task

ReceiveAsync() публичный Метод

Receive a message from the network
public ReceiveAsync ( System.TimeSpan timeout ) : Task
timeout System.TimeSpan
Результат Task

ReceiveAsync() публичный Метод

Receive a message from the network
public ReceiveAsync ( System.TimeSpan timeout, CancellationToken token ) : Task
timeout System.TimeSpan
token System.Threading.CancellationToken
Результат Task

ReceiveAsync() публичный Метод

Receive a message from the network
public ReceiveAsync ( int timeoutMilliseconds ) : Task
timeoutMilliseconds int
Результат Task

Send() публичный Метод

Send a message to the peer.
public Send ( byte message ) : void
message byte the message to send
Результат void

SendAsync() публичный Метод

Send a message to the peer.
public SendAsync ( byte message ) : Task
message byte the message to send
Результат Task

SendRequest() публичный Метод

Send a message to the peer and wait for a reply
public SendRequest ( byte message ) : WireContext
message byte the message to send
Результат WireContext

SendRequestAsync() публичный Метод

Send a message to the peer and wait for a reply
public SendRequestAsync ( byte message ) : Task
message byte the message to send
Результат Task