Ejemplo n.º 1
0
        public void JsonTest1()
        {
            ServerSocketListen ssl = new ServerSocketListen();
            Socket             s   = ssl.StartHost();
            JsonBytes          jb  = new JsonBytes(s.Accept());

            try
            {
                jb.Recived += PrintObject;
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 2
0
        public void ClientHandlerSerialTest2()
        {
            ServerSocketListen ssl = new ServerSocketListen();
            Socket             s   = ssl.StartHost();
            ClientHandler      ch  = new ClientHandler(s, true, true);

            new Thread(ch.AcceptClientsSerialBytes).Start();
            try
            {
                ch.Recived += PrintObject;
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 3
0
        public void JsonTest2()
        {
            List <JsonBytes>   listJB = new List <JsonBytes>();
            ServerSocketListen ssl    = new ServerSocketListen();
            Socket             s      = ssl.StartHost();

            while (true)
            {
                JsonBytes jb = new JsonBytes(s.Accept());
                try
                {
                    jb.Recived += PrintObject;
                }
                catch (Exception)
                {
                }
                listJB.Add(jb);
            }
        }
Ejemplo n.º 4
0
        public void JsonTest3()
        {
            List <JsonBytes>   listJB = new List <JsonBytes>();
            ServerSocketListen ssl    = new ServerSocketListen();
            Socket             s      = ssl.StartHost();

            for (int i = 0; i < 3; i++)
            {
                JsonBytes jb = new JsonBytes(s.Accept());
                try
                {
                    jb.Recived += PrintObject;
                }
                catch (Exception)
                {
                }
                listJB.Add(jb);
            }
            foreach (var item in listJB)
            {
                DataClassTrans d1 = new DataClassTrans("server1");
                item.Send(d1);
            }
        }