// ------------------------------- //
// -------- Start of File -------- //
// ------------------------------- //
// ----------------------------------------------------------- //
// C++ Header File Name: httpserv.h
// C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC
// Produced By: glNET Software
// File Creation Date: 09/20/1999
// Date Last Modified: 05/25/2001
// Copyright (c) 2001 glNET Software
// ----------------------------------------------------------- // 
// ---------- 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
gxThread library.
*/
// ----------------------------------------------------------- //   
#ifndef __GX_S_HTTP_SERVER_HPP__
#define __GX_S_HTTP_SERVER_HPP__

#include "gxthread.h"
#include "gxsocket.h"

class gxHTTPServer : public gxSocket, public gxThread
{
public:
  gxHTTPServer() { }
  ~gxHTTPServer() { }

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: // gxThread Interface
  void *ThreadEntryRoutine(gxThread_t *thread);
  void ThreadExitRoutine(gxThread_t *thread);
  void ThreadCleanupHandler(gxThread_t *thread);
};

#endif // __GX_S_HTTP_SERVER_HPP__
// ----------------------------------------------------------- // 
// ------------------------------- //
// --------- End of File --------- //
// ------------------------------- //