Esempio n. 1
0
 private static void Connect(SocketClient.EventSocket eventSocket, string name)
 {
     eventSocket      = new SocketClient.EventSocket(serverIP, 8800);
     eventSocket.Name = name;
     eventSocket.NewPackageReceived += EventSocket_NewPackageReceived;
     eventSocket.Connected          += EventSocket_Connected;
     eventSocket.Error  += EventSocket_Error;
     eventSocket.Closed += EventSocket_Closed;
     Task <bool> ts = eventSocket.Connect();
 }
Esempio n. 2
0
        private static void MakeAlotOfClient50()
        {
            for (int i = 0; i <= 50; i++)
            {
                Task.Run(() =>
                {
                    SocketClient.EventSocket eventSocket = new SocketClient.EventSocket(serverIP, 8800);
                    eventSocket.NewPackageReceived      += EventSocket_NewPackageReceived;
                    eventSocket.Connected += EventSocket_Connected;
                    eventSocket.Error     += EventSocket_Error;
                    eventSocket.Closed    += EventSocket_Closed;

                    Task <bool> ts = eventSocket.Connect();
                });
                // Thread.Sleep(5);
            }
        }
Esempio n. 3
0
        private static void MakeAlotOfClient()
        {
            for (int i = 0; i < 9; i++)
            {
                Task.Run(() =>
                {
                    int j = i;
                    SocketClient.EventSocket eventSocket = new SocketClient.EventSocket(serverIP, 8800);
                    eventSocket.Name = j.ToString();
                    eventSocket.NewPackageReceived += EventSocket_NewPackageReceived;
                    eventSocket.Connected          += EventSocket_Connected;
                    eventSocket.Error  += EventSocket_Error;
                    eventSocket.Closed += EventSocket_Closed;

                    Task <bool> ts = eventSocket.Connect();
                });
                Thread.Sleep(100);
            }
        }