Code Search for Developers
 
 
  

server_socket.cc from AlphaMail at Krugle


Show server_socket.cc syntax highlighted

#include <exception>
#include <string>
#include <iostream>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>

#include "Socket.h"

using namespace std;
using namespace Net;

int main(int argc, char **argv)
{
   try {
      ServerSocket server("127.0.0.1", "4321");
      Socket *s;
      std::string line;
      struct timeval t;

      while(s = server.accept()) {
         while(true) {
            try {
               t.tv_sec = 5; 
               t.tv_usec = 0;
               line=s->getLine(&t);
               cout << "Client says: " << line;
            } catch(std::exception &e) {
               cout << "Client connection done: " << e.what() << endl;
               break;
            }
         }
      }
   } catch(exception &e) {
      cerr << e.what() << endl;
   }

   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
  memory_bug.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