コード例 #1
0
 private async Task SendPacket(OverlayPacket packet)
 {
     if (this.isBatching)
     {
         this.batchPackets.Add(packet);
     }
     else
     {
         await this.webSocketServer.Send(packet);
     }
 }
コード例 #2
0
        private async Task SendPacket(string type, object contents)
        {
            OverlayPacket packet = new OverlayPacket(type, JObject.FromObject(contents));

            if (this.isBatching)
            {
                this.batchPackets.Add(packet);
            }
            else
            {
                await this.webSocketServer.Send(packet);
            }
        }