Ejemplo n.º 1
0
        /// <summary>
        /// Realiza la desconexión del cliente
        /// </summary>
        /// <param name="dr">Tipo de desconexión</param>
        public void Disconnect(EDissconnectReason dr)
        {
            bool disok = false;

            if (_Socket != null)
            {
                lock (_Socket)
                {
                    try
                    {
                        _Socket.Close();
                        _Socket.Dispose();
                    }
                    catch { }
                    _Socket = null;
                    disok   = true;
                }
            }

            if (_Stream != null)
            {
                try { _Stream.Dispose(); }
                catch { }
                _Stream = null;
            }

            if (disok)
            {
                _DisconnectReason = dr;
                if (OnDisconnect != null)
                {
                    OnDisconnect(this, dr);
                }
            }
        }
Ejemplo n.º 2
0
 void RaiseOnDisconnect(XPloitSocketClient cl, EDissconnectReason dr)
 {
     if (cl == null)
     {
         return;
     }
     if (OnDisconnect != null)
     {
         OnDisconnect(this, cl, dr);
     }
 }
Ejemplo n.º 3
0
        void Remove(XPloitSocketClient c, EDissconnectReason dr)
        {
            lock (_Clients)
            {
                int l = _Clients.Length;
                XPloitSocketClient[] cs = new XPloitSocketClient[l - 1];
                for (int x = 0, y = 0; x < l; x++)
                {
                    XPloitSocketClient o = _Clients[x];
                    if (o == c)
                    {
                        continue;
                    }

                    cs[y] = o;
                    y++;
                }
                _Clients = cs;
            }
            if (c != null)
            {
                c.Disconnect(dr);
            }
        }
Ejemplo n.º 4
0
 void _Socket_OnDisconnect(XPloitSocket sender, XPloitSocketClient client, EDissconnectReason e)
 {
 }
Ejemplo n.º 5
0
 void _Socket_OnDisconnect(XPloitSocket sender, XPloitSocketClient client, EDissconnectReason e)
 {
     
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Realiza la desconexión del cliente
        /// </summary>
        /// <param name="dr">Tipo de desconexión</param>
        public void Disconnect(EDissconnectReason dr)
        {
            bool disok = false;
            if (_Socket != null)
            {
                lock (_Socket)
                {
                    try
                    {
                        _Socket.Close();
                        _Socket.Dispose();
                    }
                    catch { }
                    _Socket = null;
                    disok = true;
                }
            }

            if (_Stream != null)
            {
                try { _Stream.Dispose(); }
                catch { }
                _Stream = null;
            }

            if (disok)
            {
                _DisconnectReason = dr;
                if (OnDisconnect != null)
                    OnDisconnect(this, dr);
            }
        }
Ejemplo n.º 7
0
 void RaiseOnDisconnect(XPloitSocketClient cl, EDissconnectReason dr)
 {
     if (cl == null) return;
     if (OnDisconnect != null) OnDisconnect(this, cl, dr);
 }
Ejemplo n.º 8
0
        void Remove(XPloitSocketClient c, EDissconnectReason dr)
        {
            lock (_Clients)
            {
                int l = _Clients.Length;
                XPloitSocketClient[] cs = new XPloitSocketClient[l - 1];
                for (int x = 0, y = 0; x < l; x++)
                {
                    XPloitSocketClient o = _Clients[x];
                    if (o == c) continue;

                    cs[y] = o;
                    y++;
                }
                _Clients = cs;
            }
            if (c != null) c.Disconnect(dr);
        }