Code Search for Developers
 
 
  

request_processor.cc from AlphaMail at Krugle


Show request_processor.cc syntax highlighted

#include <exception>
#include <string>
#include <iostream>
#include <unistd.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <netxx/netxx.h>
#include <boost/thread.hpp>

#include "middleware.h"

using namespace std;
using namespace boost;
using namespace Middleware;

int main(int argc, char **argv)
{
   if(argc < 2) {
      cerr << "Pass port" << endl;
      return 1;
   }
   Netxx::StreamServer server(atoi(argv[1]), Netxx::Timeout(0), 7);
   Netxx::Peer client;
   std::string line;
   ThreadCleanup cleaner;
   CleanupDelegate *c = new CleanupDelegate(&cleaner);
   boost::thread cleaner_thread(*c);
   delete c; // A copy was made by thread

   while(client = server.accept_connection()) {
      RequestProcessor p(client, &cleaner);
      thread *t = new thread(p);
      cerr << "Thread created at: " << (void*)t << endl;
      cleaner.manage(p.getID(), t);
   }

   cleaner_thread.join();

   return 0;
}




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  jcorba/
    IMAPClient.java
    IMAPServer.java
    imap.idl
  Makefile
  cache_entry.cc
  client_socket.cc
  date_time.cc
  imaps_test.cc
  map_test.cc
  mkdir.cc
  mm.cc
  oop.cc
  parse_response.cc
  regex1.cc
  request_processor.cc
  server_socket.cc
  split.cc
  ssl.c
  ssl_client.cpp