public bool StartServer(int port, int maxConnections)
 {
     ServerMaxConnections = maxConnections;
     serverPeer           = new KCPPeer("SERVER", clientSetting, serverSetting);
     serverPeer.Start(port);
     return(true);
 }
 public void StopServer()
 {
     if (serverPeer != null)
     {
         serverPeer.Stop();
         serverPeer = null;
     }
 }
 public void StopClient()
 {
     if (clientPeer != null)
     {
         clientPeer.Stop();
         clientPeer = null;
     }
 }
 public bool StartClient(string address, int port)
 {
     clientPeer = new KCPPeer("CLIENT", clientSetting, serverSetting);
     clientPeer.Start();
     return(clientPeer.Connect(address, port));
 }