C# Class CqlSharp.Network.TcpClientExtensions

Afficher le fichier Open project: reuzel/CqlSharp

Méthodes publiques

Méthode Description
ConnectAsync ( this client, IPAddress address, int port, int timeout ) : Task

Connects the client to the given remote address and port, using a maximum timeout. The client will be closed when the timeout has passed and the client is still not connected

SetKeepAlive ( this client, ulong time ) : void

Sets the keep-alive interval for the socket.

SetKeepAlive ( this client, ulong time, ulong interval ) : void

Sets the keep-alive interval for the socket.

based on: http://www.codekeep.net/snippets/269152eb-726b-4cd5-a22d-4e7cef27f93f.aspx

Method Details

ConnectAsync() public static méthode

Connects the client to the given remote address and port, using a maximum timeout. The client will be closed when the timeout has passed and the client is still not connected
When a timeout has occured. In this case the socket will have been closed.
public static ConnectAsync ( this client, IPAddress address, int port, int timeout ) : Task
client this The client.
address System.Net.IPAddress The address to connect to.
port int The port to connect to.
timeout int The timeout in ms. Set to 0 to skip timeouts
Résultat Task

SetKeepAlive() public static méthode

Sets the keep-alive interval for the socket.
public static SetKeepAlive ( this client, ulong time ) : void
client this
time ulong Time between two keep alive "pings".
Résultat void

SetKeepAlive() public static méthode

Sets the keep-alive interval for the socket.
based on: http://www.codekeep.net/snippets/269152eb-726b-4cd5-a22d-4e7cef27f93f.aspx
public static SetKeepAlive ( this client, ulong time, ulong interval ) : void
client this TcpClient to set KeepAlive value on
time ulong Time between two keep alive "pings".
interval ulong Time between two keep alive "pings" when first one fails.
Résultat void