SystemExt.Demo/Network.cs
/// <summary>
/// A demo which implements a basic TCP echo server.
/// </summary>
/// <param name="arg">
/// Command line arguments.
/// </param>
/// <returns>
/// The code to terminate the application with on exit.
/// </returns>
A demo which implements a basic TCP echo server.
A demo which implements a basic TCP echo server .
private static int RunEchoClient(string[] arg)
        {
            var address = Prompt.String("What hostname or IP addresss do you want to connect to", "127.0.0.1");
            var port = (ushort)Prompt.Integer("What port do you want to connect to", 9999, ushort.MinValue, ushort.MaxValue);
            var client = TCPClient<EchoClient>.Connect(address, port);
            Console.WriteLine("Now connecting to {0}:{1}, press return to exit.", address, port);
            for (var line = Console.ReadLine(); !string.IsNullOrEmpty(line); line = Console.ReadLine())
            {
                client.Write(line);
            }
            return 0;
        }
private static int RunEchoClient ( string [ ] arg ) { var address = Prompt . String ( " " , " " ) ; var port = ( ushort ) Prompt . Integer ( " " , 9999 , ushort . MinValue , ushort . MaxValue ) ; var client = TCPClient < EchoClient > . Connect ( address , port ) ; Console . WriteLine ( " " , address , port ) ; for ( var line = Console . ReadLine ( ) ; ! string . IsNullOrEmpty ( line ) ; line = Console . ReadLine ( ) ) { client . Write ( line ) ; } return 0 ; }
A demo which implements a basic TCP echo server.
A demo which implements a basic TCP echo server .
The code to terminate the application with on exit.
The code to terminate the application with on exit .
arg
string[]
Command line arguments.
Command line arguments .