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

source: tcpclient.c hush-3.0b4/auxiliary/net/examples/cs/cs-simple


[.] - [up] [top] - index make source scripts configure
  // tcpclient.cc
  // simple client based on TCP sockets, sends and receives a string
  
  include <iostream.h>
  
  include <net/cs/tcp/client.h>
  
  include <stdlib.h>
  
  const char teststr[] = "Hello Server!";
  
  int main(int argc, char* argv[])
  {
      char buffer[256];
  
      if (argc < 3)
      {
          cout << "Usage: client <hostname> " << endl;
          exit(1);
      }
  
      csclient* client = new tcp_client(argv[1], atoi(argv[2]));
  
      cout << "Writing message..." << endl;
      client -> writemsg(teststr, sizeof(teststr));
      cout << "Reading message..." << endl;
      cout << client -> readmsg(buffer, sizeof(buffer));
      cout << " bytes: " << buffer << endl;
  
      delete client;
  
      return 0;
  }
  
  

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