ExtensionMethods.RequestAsync(TMessage) Method (Tcp.Generic.SecureTcpClient(TMessage), TMessage, Int32)
From Tungsten Suite
Tungsten
|
|
ExtensionMethodsRequestAsyncTMessage Method (TcpGenericSecureTcpClientTMessage, TMessage, Int32) |
Sends a request to the server and waits for a response. Can be used along with, or in lieu of, the regular method of calling Write and handling the BytesReceived event.
Namespace: W.Net
Assembly: Tungsten.Net (in Tungsten.Net.dll) Version: 2.0.2
C#
public static Task<TMessage> RequestAsync<TMessage>( this TcpGenericSecureTcpClient<TMessage> client, TMessage request, int msTimeout )
Parameters
- client
- Type: W.NetTcpGenericSecureTcpClientTMessage
The W.Net.Tcp.Generic.SecureTcpClient<TMessage> instance - request
- Type: TMessage
The request to be made to the server - msTimeout
- Type: SystemInt32
The time to wait for a response
Type Parameters
- TMessage
- The message Type
Return Value
Type: TaskTMessagedefault(TMessage) if a timeout occurs, otherwise the server's response