Exemplo n.º 1
0
        static void Main(string[] args)
        {
            server          server = new server();
            HandleDataClass hdc    = new HandleDataClass();

            //start server thread
            Thread serverThread = new Thread(() => server.Listen());

            serverThread.Start();

            //start Handler thread
            Thread dataHandlerThread = new Thread(() => hdc.SubscribeToEvent(server));

            dataHandlerThread.Start();



            //Do other things
            while (true)
            {
                Thread.Sleep(100);
            }
        }
Exemplo n.º 2
0
 public void SubscribeToEvent(server server)
 {
     server.DataReceivedEvent += Server_DataReceivedEvent;
 }