Ejemplo n.º 1
0
        public void Start(int port)
        {
            var server = new MicroMessageTcpListener();

            server.MessageReceived += OnServerMessageReceived;
            server.Start(IPAddress.Any, port);;
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            ObjectFactory.Configure(x => x.Scan(z =>
            {
                z.TheCallingAssembly();
                z.WithDefaultConventions();
                z.RegisterConcreteTypesAgainstTheFirstInterface();
            }));

            var settings = new ChannelTcpListenerConfiguration(
                () => new MicroMessageDecoder(new JsonSerializer()),
                () => new MicroMessageEncoder(new JsonSerializer()));

            var server = new MicroMessageTcpListener(settings)
            {
                MessageReceived = OnServerMessage
            };

            server.Start(IPAddress.Any, 1234);

            Console.WriteLine("Server started. Press any key to exit...");
            Console.ReadKey();
        }
Ejemplo n.º 3
0
 public void Test()
 {
     var sut = new MicroMessageTcpListener();
 }
 public void Test()
 {
     var sut = new MicroMessageTcpListener(new ChannelTcpListenerConfiguration(null, null));
 }