Courier.Core.Tcp.TcpServer.Bind C# (CSharp) Method

Bind() public method

public Bind ( int port ) : IPort
port int
return IPort
        public IPort Bind(int port)
        {
            return Bind(port, new BinaryFormatter());
        }

Same methods

TcpServer::Bind ( int portNumber, IFormatter formatter ) : IPort

Usage Example

Ejemplo n.º 1
0
        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);
        }
All Usage Examples Of Courier.Core.Tcp.TcpServer::Bind
TcpServer