Example #1
0
        static void Server_AcceptSocket(System.Net.Sockets.Socket socket)
        {
            CrossFileClient client = new CrossFileClient(socket);

            client.AsyncReceive();

            ClientMgr.Instance.Add(client);
        }
Example #2
0
        public bool Remove(CrossFileClient client)
        {
            if (client == null || client.Socket == null) return false;

            lock (m_locker)
            {
                return m_list.Remove(client.Socket);
            }
        }
Example #3
0
        public bool Remove(CrossFileClient client)
        {
            if (client == null || client.Socket == null)
            {
                return(false);
            }

            lock (m_locker)
            {
                return(m_list.Remove(client.Socket));
            }
        }
Example #4
0
        public void Add(CrossFileClient client)
        {
            if (client == null || client.Socket == null) return;

            lock (m_locker)
            {
                if (m_list.ContainsKey(client.Socket))
                {
                    m_list.Add(client.Socket, client);

                    client.DisconnectSocket += new DisconnectSocketDelegate(client_DisconnectSocket);
                }
            }
        }
Example #5
0
        public void Add(CrossFileClient client)
        {
            if (client == null || client.Socket == null)
            {
                return;
            }

            lock (m_locker)
            {
                if (m_list.ContainsKey(client.Socket))
                {
                    m_list.Add(client.Socket, client);

                    client.DisconnectSocket += new DisconnectSocketDelegate(client_DisconnectSocket);
                }
            }
        }