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

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

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

            return c;
        }
Esempio 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);
        }