Exemplo n.º 1
0
        public bool ConnectServer(string IP, int PORT)
        {
            isSV           = false;
            se             = new SocketExt(IP, PORT, false);
            se.ReceiveData = Reload;
            se.ExitDraw    = ExitDraw;

            if (!se.ConnectSV())
            {
                DetectSocket?.Invoke("Disconnect", "0.0.0.0", 0);
                return(false);
            }
            DetectSocket?.Invoke("Connecting", IP, PORT);
            Updates();
            return(true);
        }
Exemplo n.º 2
0
        //
        public bool MakeServer(string IP, int PORT)
        {
            isSV            = true;
            se              = new SocketExt(IP, PORT, true);
            se.ReceiveData  = Reload;
            se.ExitDraw     = ExitDraw;
            se.ClientStatus = (s) => ClientStatus?.Invoke(s);

            if (!se.MakeSV())
            {
                DetectSocket?.Invoke("Disconnect", "0.0.0.0", 0);
                return(false);
            }
            DetectSocket?.Invoke("Listening", IP, PORT);
            ClientStatus?.Invoke(0);
            return(true);
        }