예제 #1
0
        public static ServerConnectSettings FromXML(string xml, IPEndPoint endpoint)
        {
            var config = new ServerConnectSettings();

            config.EndPoint = endpoint;
            config.RSA      = RSA.Create();
            config.RSA.FromXmlString(xml);
            return(config);
        }
예제 #2
0
 public ConnectToServerTask(ServerConnectSettings settings, CancellationToken token)
 {
     m_Settings = settings;
     m_Randam   = Random.GenBytes(EncryptorKey.RandamKey);
     m_Token    = token;
 }
예제 #3
0
 public static async Task <ClientConnection> ConnectToServer(ServerConnectSettings settings, CancellationToken token)
 {
     return(new ClientConnection(await new ConnectToServerTask(settings, token).Run()));
 }
예제 #4
0
 public static Task <ClientConnection> ConnectToServer(ServerConnectSettings settings)
 {
     return(ConnectToServer(settings, CancellationToken.None));
 }