Esempio n. 1
0
        public void DisposeTest()
        {
            var wsProtocol = new WebSocketProtocol();

            wsProtocol.Port = 4884;
            wsProtocol.Listen();
            wsProtocol.Dispose();
            Assert.IsFalse(wsProtocol.Listening);
        }
        public void Initialize()
        {
            ManualResetEvent mevent = new ManualResetEvent(false);

            ipv4Server = new WebSocketProtocol()
            {
                Port = PORT, Address = hostAddress
            };
            ipv4Server.Port = PORT;
            ipv4Server.OnConnectionRequested += (socket) =>
            {
                ipv4ServerClient = socket;
                mevent.Set();
            };
            ipv4Server.Listen();
            mevent.Reset();

            ipv4Client = this.CreateWSClientProtocol().Connect(serverAddress, PORT);
            mevent.WaitOne(1000);
        }
Esempio n. 3
0
 public void ListenTest()
 {
     wsProtocol.Listen();
     Assert.IsTrue(wsProtocol.Listening, "Listening Flag was not turned on.");
 }