Ejemplo n.º 1
0
int authserv(int po = 3000)
{

   UChar_t oauth = kSrvAuth;

   TServerSocket *ss = 0;
   TSocket *s = 0;

   cout << "authserv: starting a (parallel) server socket on port "
        << po << " with authentication" << endl;
 
   ss = new TPServerSocket(po);

   // Get the connection
   s = ss->Accept(oauth);

   // Print out;
   if (s) 
      if (s->IsAuthenticated()) 
         cout << "authserv: srv auth socket: OK" << endl;
      else
         cout << "authserv: srv auth socket: failed" << endl;

   // Cleanup
   if (s) delete s;
   if (ss) delete ss;
}