Ejemplo n.º 1
0
    public void Connect(string IP, int port)
    {
        if (isConnected)
        {
            isConnected = false;
            client.Disconnect();
        }
        client      = UdpUser.ConnectTo(IP, port);
        isConnected = true;
        _thread.Start();

        RequestScheme();
    }
Ejemplo n.º 2
0
        public static void StartNetworkSystem()
        {
            Config.EnableMessageType(NetIncomingMessageType.ConnectionLatencyUpdated);
            Config.EnableMessageType(NetIncomingMessageType.NatIntroductionSuccess);
            Config.EnableMessageType(NetIncomingMessageType.UnconnectedData);

            ClientConnection = new NetClient(Config);
            ClientConnection.Start();

            NetworkServerList.RefreshMasterServers();
            SendThread.Start(TaskScheduler.Default);
            ReceiveThread.Start(TaskScheduler.Default);
            NetworkServerList.RequestServers();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Starts the background thread that listens for incoming PDU's.
 /// </summary>
 public void StartListening()
 {
     ThreadSetup();
     ReceiveThread.Start();
 }