Ejemplo n.º 1
0
        public async void SendMessage_SingleMessageIsSentSuccessfully_ReceivedMessageIsCorrect()
        {
            var port   = 15000;
            var client = new SimpleClient(port);
            var server = new SimpleServer(port);

            server.Listen();
            client.Listen();
            client.SendCommand(new GetMessagesCommand("First message"));
            await server.AcceptCommand();

            var receivedCommands = server.ReceivedCommands;

            receivedCommands.Should().BeEquivalentTo("First message");
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     server = new SimpleServer(8081);
     server.OnSocketReceive += server_OnSocketReceive;
     server.Listen();
 }