Stop() public method

public Stop ( ) : void
return void
Esempio n. 1
0
    static void Main(string[] args)
    {
        NetConfig.LatencySimulation = true;
        Connector client = new Connector("Sample1.1", false);

        Clock fastClock = new Clock(0.02f);
        Clock slowClock = new Clock(1.0f);
        fastClock.OnFixedUpdate += SendPayload;
        slowClock.OnFixedUpdate += SendNotification;

        Program.peer = client.Connect("127.0.0.1:42324");

        while (true)
        {
          fastClock.Tick();
          slowClock.Tick();
          client.Update();

          if (Console.KeyAvailable)
          {
        ConsoleKeyInfo key = Console.ReadKey(true);
        switch (key.Key)
        {
          case ConsoleKey.F1:
            client.Stop();
            return;

          default:
            break;
        }
          }
        }
    }
Esempio n. 2
0
    static void Main(string[] args)
    {
        Connector server = new Connector("Sample1.1", true);

        server.Host(42324);

        while (true)
        {
          server.Update();

          if (Console.KeyAvailable)
          {
        ConsoleKeyInfo key = Console.ReadKey(true);
        switch (key.Key)
        {
          case ConsoleKey.F1:
            server.Stop();
            return;

          default:
            break;
        }
          }
        }
    }