Пример #1
0
 /// <summary>
 /// Connects to a given EndPoint
 /// </summary>
 /// <param name="endpoint"></param>
 public void Connect(EndPoint endpoint)
 {
     // return if already started connection process
     if (!SetConnectionState(ConnectionState.AwaitingChallenge, ConnectionState.ReadyToConnect))
     {
         return;
     }
     remoteEndPoint = endpoint;
     socket.Bind(new IPEndPoint(IPAddress.Any, 0));
     localSalt = Udp.GenerateLocalSalt();
     timer.Start();
     StartRead();
     SendConnect();
 }
Пример #2
0
        private ConnectRequestState CreateConnectionRequest(ulong clientSalt, IPEndPoint ipEndpoint)
        {
            ulong serverSalt = Udp.GenerateLocalSalt();

            return(new ConnectRequestState(clientSalt, serverSalt, ipEndpoint));
        }