private void StartButton_Click(object sender, RoutedEventArgs e) { _listenSocket = new SNetServer(); _listenSocket.Bind(50001); _listenSocket.Listen(500); _listenSocket.Accept(); _listenSocket.OnRecieve += ListenSocket_OnRecieve; _listenSocket.OnClientConnect += ListenSocket_OnClientConnect; _listenSocket.OnClientDisconnect += ListenSocket_OnClientDisconnect; StartButton.IsEnabled = false; }
private void TcpServerInit() { _role = "Server"; _listenSocket = new SNetServer(); _listenSocket.Bind(50001); _listenSocket.Listen(500); _listenSocket.Accept(); _listenSocket.OnRecieve += ListenSocket_OnRecieve; _listenSocket.OnClientConnect += ListenSocket_OnClientConnect; _listenSocket.OnClientDisconnect += ListenSocket_OnClientDisconnect; }