public static void Shutdown()
 {
     if (NetLogFilter.logInfo)
     {
         Debug.Log("Transport Layer Shutdown");
     }
     client?.Disconnect();
     server?.Stop();
 }
Beispiel #2
0
 void OnGUI()
 {
     GUILayout.BeginArea(new Rect(5, 5, 150, 400));
     GUILayout.Label("Client:");
     if (GUILayout.Button("Connect 127.0.0.1"))
     {
         client.Connect("127.0.0.1", Port, true, 10);
     }
     if (GUILayout.Button("Send 0x01, 0x02"))
     {
         client.Send(new ArraySegment <byte>(new byte[] { 0x01, 0x02 }));
     }
     if (GUILayout.Button("Disconnect"))
     {
         client.Disconnect();
     }
     GUILayout.EndArea();
 }
Beispiel #3
0
 public void TearDown()
 {
     client.Disconnect();
     server.Stop();
 }
Beispiel #4
0
 public override void ClientDisconnect() => client.Disconnect();