public async Task SendEventAsync(ProbeEvent payload)
        {
            if (this.AntennaArray.State != WebSocketState.Open)
            {
                return;
            }

            var bytes = this.Serializer.Serialize(payload);

            await this.SendSemaphore.WaitAsync(1);

            try
            {
                await this.AntennaArray.SendAsync(bytes, WebSocketMessageType.Binary, true, this.CancellationToken);
            }
            finally
            {
                this.SendSemaphore.Release(1);
            }
        }
Ejemplo n.º 2
0
 internal ProbeEventArgs(ProbeEvent @event)
 {
     this.Event = @event;
 }