コード例 #1
0
 public static T Deserialize <T>(this CoflnetEncoder encoder, MessageEventArgs args)
 {
     return(encoder.Deserialize <T>(args.RawData));
 }
コード例 #2
0
 public static ServerCommandData Deserialize(this CoflnetEncoder encoder, MessageEventArgs args)
 {
     return(encoder.Deserialize <ServerCommandData>(args.RawData));
 }
コード例 #3
0
 /// <summary>
 /// Send the specified data after encoding with the given socket.
 /// </summary>
 /// <param name="encoder">Encoder.</param>
 /// <param name="data">Data.</param>
 /// <param name="socket">Socket.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static void Send <T>(this CoflnetEncoder encoder, T data, CoflnetWebsocketServer socket)
 {
     socket.SendBack(encoder.Serialize <T>(data));
 }
コード例 #4
0
ファイル: CoflnetSocket.cs プロジェクト: Coflnet/cloud
 public static CommandData SerializeServerCommandData <T>(T target, string type, CoflnetEncoder encoder)
 {
     return(new CommandData(type, encoder.Serialize <T>(target)));
 }