Class SocketClientExtensions
Extension methods for ISocketClient.
Namespace: TehGM.Wolfringo.Socket
Assembly: Wolfringo.Core.dll
Syntax
public static class SocketClientExtensions
Methods
| Improve this Doc View SourceSendAsync(ISocketClient, String, JToken, IEnumerable<Byte[]>, CancellationToken)
Sends (emits) event to the server.
Declaration
public static Task<uint> SendAsync(this ISocketClient client, string eventName, JToken data, IEnumerable<byte[]> binaryMessages, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
ISocketClient | client | Socket client to send event from. |
String | eventName | Event name to send. |
Newtonsoft.Json.Linq.JToken | data | Json data to pack with |
IEnumerable<Byte[]> | binaryMessages | Collection of binary messages to send. |
CancellationToken | cancellationToken | Token which can be used to abort sending. |
Returns
Type | Description |
---|---|
Task<UInt32> | ID of the sent message. |