Inheritance: NetworkConnection, IClientConnection
Exemplo n.º 1
0
		public NetworkClientSimulator (NetworkClientConnection connection)
		{
			if (connection == null)
				throw new ArgumentNullException ("connection");

			this.connection = connection;
		}
Exemplo n.º 2
0
 public static ScreenshareClient CreateNew()
 {
     var connection = new NetworkClientConnection(ScreenshareProtocol.Instance);
     return new ScreenshareClient(connection);
 }
Exemplo n.º 3
0
        protected override IClientConnection SetupClientConnection(out RSAAsymmetricKey k)
        {
            var c = new NetworkClientConnection (p);
            k = (RSAAsymmetricKey) c.LocalKey;

            return c;
        }
Exemplo n.º 4
0
        protected override IClientConnection SetupClientConnection(out IAsymmetricKey k)
        {
            var c = new NetworkClientConnection (p);
            k = c.PublicAuthenticationKey;

            return c;
        }
Exemplo n.º 5
0
        public void RejectSha1()
        {
            TearDown();

            provider = new NetworkConnectionProvider (new [] { MockProtocol.Instance }, (IPEndPoint)EndPoint, MaxConnections, () => new RSACrypto(), new string[] { "SHA256" } );
            provider.Start (MessageTypes);

            var test = new AsyncTest<DisconnectedEventArgs> (d => Assert.AreEqual (ConnectionResult.FailedHandshake, d.Result));

            var client = new NetworkClientConnection (new[] { MockProtocol.Instance }, () => new MockSha1OnlyCrypto());
            client.ConnectAsync (EndPoint, MessageTypes);

            client.Connected += test.FailHandler;
            client.Disconnected += test.PassHandler;

            test.Assert (10000);
        }