public void Connect(string IP, int port) { if (isConnected) { isConnected = false; client.Disconnect(); } client = UdpUser.ConnectTo(IP, port); isConnected = true; _thread.Start(); RequestScheme(); }
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(); }
/// <summary> /// Starts the background thread that listens for incoming PDU's. /// </summary> public void StartListening() { ThreadSetup(); ReceiveThread.Start(); }