// ------------------------------- //
// -------- Start of File -------- //
// ------------------------------- //
// ----------------------------------------------------------- //
// C++ Header File Name: httpserv.h
// C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC
// Produced By: Doug Gaer   
// File Creation Date: 09/20/1999
// Date Last Modified: 08/10/2000
// Copyright (c) 1997, 2000 Douglas M. Gaer
// ----------------------------------------------------------- // 
// ---------- Include File Description and Details  ---------- // 
// ----------------------------------------------------------- // 
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
 
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA

A very simple multi-threaded HTTP server built using the
vbThread library.
*/
// ----------------------------------------------------------- //   
#ifndef __VBS_HTTP_SERVER_HPP__
#define __VBS_HTTP_SERVER_HPP__

#include "vbthread.h"
#include "vbsocket.h"

class vbHTTPServer : public vbSocket, public vbThread
{
public:
  vbHTTPServer() { }
  ~vbHTTPServer() { }

public:
  int InitHTTPServer(int port = 80, int max_connections = SOMAXCONN);

public: // Statistical information
  int RemotePortNumber(int &port);
  int HostName(char *hs);
  int RemoteHostName(char *hs);

private: // vbThread Interface
  void *ThreadEntryRoutine(vbThread_t *thread);
  void ThreadExitRoutine(vbThread_t *thread);
  void ThreadCleanupHandler(vbThread_t *thread);
};

#endif // __VBS_HTTP_SERVER_HPP__
// ----------------------------------------------------------- // 
// ------------------------------- //
// --------- End of File --------- //
// ------------------------------- //