Esempio n. 1
0
        protected virtual void OnDataException(UdpServerEventArgs arg)
        {
            NetStat.Set("Errors", 1, arg.Data?.Length ?? 0);
            DataException?.Invoke(this, arg);

            Helper.OnException(arg.Exception);
        }
Esempio n. 2
0
        protected internal void OnDataLoad(TcpServerEventArgs arg)
        {
            NetStat.Set("Server Receive", 1, arg.Length);

            if (logEvents)
            {
                Helper.Logs.Add(new StateInfo("NetService", "DataLoad", string.Format("{0} {1} {2}",
                                                                                      arg.Client.Socket.LocalEndPoint,
                                                                                      arg.Client.Socket.RemoteEndPoint,
                                                                                      Helper.TextDisplayFormat(arg.Length, "size"))));
            }

            DataLoad?.Invoke(this, arg);

            arg.Stream.Dispose();
        }
Esempio n. 3
0
 protected virtual void OnDataLoad(UdpServerEventArgs arg)
 {
     NetStat.Set("Data Receive", 1, arg.Length);
     DataLoad?.Invoke(this, arg);
 }
Esempio n. 4
0
 protected virtual void OnDataSend(UdpServerEventArgs arg)
 {
     DataSend?.Invoke(this, arg);
     NetStat.Set("Data Send", 1, arg.Length);
 }