Ejemplo n.º 1
0
 public void InvokeReceiveIfNotNull(NetworkData data)
 {
     if (NetworkEventLoop.Receive != null)
     {
         NetworkEventLoop.Receive(data, this);
     }
 }
Ejemplo n.º 2
0
        public void BeginReceive(ReceivedDataCallback callback)
        {
            Receive += callback;
            foreach (var msg in UnreadMessages.DequeueAll())
            {
                NetworkEventLoop.Receive(msg, this);
            }

            BeginReceiveInternal();
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Method is called directly by the <see cref="ReactorBase" /> implementation to send data to this
 ///     <see cref="IConnection" />.
 ///     Can also be called by the socket itself if this reactor doesn't use <see cref="ReactorProxyResponseChannel" />.
 /// </summary>
 /// <param name="data">The data to pass directly to the recipient</param>
 internal virtual void OnReceive(NetworkData data)
 {
     if (NetworkEventLoop.Receive != null)
     {
         NetworkEventLoop.Receive(data, this);
     }
     else
     {
         UnreadMessages.Enqueue(data);
     }
 }