internal void OnConnectFailed(Detail.Connector connector) { RemoveConnector(connector); var msg = new SysConnectFailed(); msg.Address = connector.Address.ToString(); }
public Result Connect(IPAddress ip, ushort port) { var connector = new Detail.Connector(ip, port); var result = connector.BeginConnect(); if (result) { AddConnector(connector); } return(result); }
private void RemoveConnector(Detail.Connector connector) { rwLock.EnterWriteLock(); connectors.Remove(connector); rwLock.ExitWriteLock(); }
private void AddConnector(Detail.Connector connector) { rwLock.EnterWriteLock(); connectors.Add(connector, true); rwLock.ExitWriteLock(); }
internal void OnConnected(Detail.Connector connector, Socket socket) { OnNewSocket(socket, false); RemoveConnector(connector); }