public IPort Bind(int port)
{
return Bind(port, new BinaryFormatter());
}
TcpServer::Bind ( int portNumber, IFormatter formatter ) : IPort |
static void Main(string[] args) { IServer server = new TcpServer(); IPort port = server.Bind(8181); port.AddHandler(new ServerHandler()); IPipe pipe = new TcpPipe("localhost", 8181); pipe.AddHandler(new ClientHandler()); String message; do { Console.Write("Message to send: "); message = Console.ReadLine(); if (message.Length > 0) { pipe.Send(message); } } while(message.Length > 0); }