コード例 #1
0
 public bool StartServer(int port, int maxConnections)
 {
     ServerMaxConnections = maxConnections;
     serverPeer           = new KCPPeer("SERVER", clientSetting, serverSetting);
     serverPeer.Start(port);
     return(true);
 }
コード例 #2
0
 public void StopServer()
 {
     if (serverPeer != null)
     {
         serverPeer.Stop();
         serverPeer = null;
     }
 }
コード例 #3
0
 public void StopClient()
 {
     if (clientPeer != null)
     {
         clientPeer.Stop();
         clientPeer = null;
     }
 }
コード例 #4
0
 public bool StartClient(string address, int port)
 {
     clientPeer = new KCPPeer("CLIENT", clientSetting, serverSetting);
     clientPeer.Start();
     return(clientPeer.Connect(address, port));
 }