The DejaVU Framework -- hush 3.0
[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?

source: clockclient.c hush-3.0b4/auxiliary/net/examples/cs/cs-clock


[.] - [up] [top] - index make source scripts configure
  // clockclient.cc
  // Client for the clockserver
  
  include <net/cs/tcp/client.h>
  
  include <unistd.h>
  include <stdlib.h>
  include <stdio.h>
  
  int main(int argc, char* argv[]) 
  {
      char buf[128];
  
  // unbuffer stdout
      setvbuf(stdout, NULL, _IONBF, 0);
  
      if (argc < 3)
      {
          printf("Usage: %s <host> ", argv[0]);
          exit(1);
      }
  
      csclient* client = new tcp_client(argv[1], atoi(argv[2]));
  
      while(1)
      {
          int count;
          client -> readmsg(buf, sizeof(buf));
  
          if (!client -> connected())
          {
              delete client;
              printf("Server has closed connection\n");
              exit(0);
          }
  
          sscanf(buf, "%d", &count);
          if (count % 24 == 0)
              printf("tik\b\b\b\a");
          else if (count % 6 == 0)
              printf("   \b\b\b");
      }
  }
  

[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?
Hush Online Technology
hush@cs.vu.nl
09/09/98