Exemplo n.º 1
0
        public MessagingTests()
        {
            server = new Server.TcpServer();
            server.Start(SERVER_PORT);

            var serverAddress = new IPAddress(new byte[] { 127, 0, 0, 1 });

            client = TcpClient.Connect(serverAddress, SERVER_PORT);
        }
Exemplo n.º 2
0
        private static void Main()
        {
            Title("JSON Serialization over TCP/IP async");
            const string host = "localhost";
            const int    port = 8899;

            PrintSetup("Starting TCP service...");
            using var serviceHost = new Server.TcpServer(port);
            serviceHost.RunAsyncQueryService(new Server.QueryService().ExecuteQueryAsync);

            PrintSetup("Staring client demo...");
            PrintSetup("-------------------------------------------------");
            new Client.AsyncDemo(() => new Client.RemoteRepository(host, port)).RunAsync().Wait();

            PrintSetup();
            PrintSetup("-------------------------------------------------");
            PrintSetup("Done.");
            WaitForEnterKey();
        }
Exemplo n.º 3
0
        private static void Main(string[] args)
        {
            ParseContextArgs(args);
            Title("JSON Serialization over TCP/IP");
            const string host = "localhost";
            const int    port = 8899;

            PrintSetup("Starting TCP service...");
            using var serviceHost = new Server.TcpServer(port);
            serviceHost.RunQueryService(new Server.QueryService().ExecuteQuery);

            PrintSetup("Staring client demo...");
            PrintSetup("-------------------------------------------------");
            new Client.Demo(() => new Client.RemoteRepository(host, port)).RunDemo();

            PrintSetup();
            PrintSetup("-------------------------------------------------");
            PrintSetup("Done.");
            WaitForEnterKey();
        }
Exemplo n.º 4
0
 public TcpServerTests()
 {
     Assert.IsFalse(Helpers.IsTcpPortListening(SERVER_PORT), "Port should be closed at start of test.");
     server = new Server.TcpServer();
     server.Start(SERVER_PORT);
 }
Exemplo n.º 5
0
 public TcpClientTests()
 {
     server = new Server.TcpServer();
     server.Start(SERVER_PORT);
 }
Exemplo n.º 6
0
 public ConnectionTests()
 {
     server = new Server.TcpServer();
     server.Start(SERVER_PORT);
 }