Пример #1
0
        internal void OnConnectFailed(Detail.Connector connector)
        {
            RemoveConnector(connector);

            var msg = new SysConnectFailed();

            msg.Address = connector.Address.ToString();
        }
Пример #2
0
        public Result Connect(IPAddress ip, ushort port)
        {
            var connector = new Detail.Connector(ip, port);

            var result = connector.BeginConnect();

            if (result)
            {
                AddConnector(connector);
            }

            return(result);
        }
Пример #3
0
 private void RemoveConnector(Detail.Connector connector)
 {
     rwLock.EnterWriteLock();
     connectors.Remove(connector);
     rwLock.ExitWriteLock();
 }
Пример #4
0
 private void AddConnector(Detail.Connector connector)
 {
     rwLock.EnterWriteLock();
     connectors.Add(connector, true);
     rwLock.ExitWriteLock();
 }
Пример #5
0
        internal void OnConnected(Detail.Connector connector, Socket socket)
        {
            OnNewSocket(socket, false);

            RemoveConnector(connector);
        }