Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Broker.");

            BrokerSocket socket = new BrokerSocket();

            socket.Start(Settings.BROKER_IP, Settings.BROKER_PORT);

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Broker");
            BrokerSocket socket = new BrokerSocket();

            socket.Start(Settings.BROKER_IP, Settings.BROKER_PORT);
            var x = new Worker();

            Task.Factory.StartNew(x.DoSendMessageWork, TaskCreationOptions.LongRunning);
            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Broker");
            BrokerSocket socket = new BrokerSocket();
            ushort       port   = 9000;

            socket.Bind(port); // va asculta la portu 9000
            socket.Listen();   // incepe sa asculte
            socket.Accept();   // accepta conexiuni
            Console.WriteLine($"Broker is listening on port {port}");

            Console.ReadLine();
        }