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); }
public ConnectToServerTask(ServerConnectSettings settings, CancellationToken token) { m_Settings = settings; m_Randam = Random.GenBytes(EncryptorKey.RandamKey); m_Token = token; }
public static async Task <ClientConnection> ConnectToServer(ServerConnectSettings settings, CancellationToken token) { return(new ClientConnection(await new ConnectToServerTask(settings, token).Run())); }
public static Task <ClientConnection> ConnectToServer(ServerConnectSettings settings) { return(ConnectToServer(settings, CancellationToken.None)); }