Class SocketClientExtensions
Extension methods for ISocketClient.
Inheritance
System.Object
SocketClientExtensions
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. |
System.String | eventName | Event name to send. |
Newtonsoft.Json.Linq.JToken | data | Json data to pack with |
System.Collections.Generic.IEnumerable<System.Byte[]> | binaryMessages | Collection of binary messages to send. |
System.Threading.CancellationToken | cancellationToken | Token which can be used to abort sending. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.UInt32> | ID of the sent message. |