C# Class WireBus.WireBusClient

A WireBus client, responsible for wrapping a TCP/IP connection and serializing the data going over the bus.
Inheritance: IDisposable
Afficher le fichier Open project: bytenik/WireBus.NET Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

Connect() public static méthode

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
Résultat WireBusClient

Connect() public static méthode

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
Résultat WireBusClient

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

ConnectAsync() public static méthode

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
Résultat Task

Disconnect() public méthode

Disconnect from the peer
public Disconnect ( ) : void
Résultat void

Dispose() public méthode

Dispose of the client
public Dispose ( ) : void
Résultat void

Receive() public méthode

Receive a message from the network
public Receive ( ) : WireContext
Résultat WireContext

ReceiveAsync() public méthode

Receive a message from the network
public ReceiveAsync ( ) : Task
Résultat Task

ReceiveAsync() public méthode

Receive a message from the network
public ReceiveAsync ( CancellationToken token ) : Task
token System.Threading.CancellationToken
Résultat Task

ReceiveAsync() public méthode

Receive a message from the network
public ReceiveAsync ( System.TimeSpan timeout ) : Task
timeout System.TimeSpan
Résultat Task

ReceiveAsync() public méthode

Receive a message from the network
public ReceiveAsync ( System.TimeSpan timeout, CancellationToken token ) : Task
timeout System.TimeSpan
token System.Threading.CancellationToken
Résultat Task

ReceiveAsync() public méthode

Receive a message from the network
public ReceiveAsync ( int timeoutMilliseconds ) : Task
timeoutMilliseconds int
Résultat Task

Send() public méthode

Send a message to the peer.
public Send ( byte message ) : void
message byte the message to send
Résultat void

SendAsync() public méthode

Send a message to the peer.
public SendAsync ( byte message ) : Task
message byte the message to send
Résultat Task

SendRequest() public méthode

Send a message to the peer and wait for a reply
public SendRequest ( byte message ) : WireContext
message byte the message to send
Résultat WireContext

SendRequestAsync() public méthode

Send a message to the peer and wait for a reply
public SendRequestAsync ( byte message ) : Task
message byte the message to send
Résultat Task