
#include <iostream>

using namespace std;


#include "Exceptions.h"
#include "Communication.h"
#include "CommunicationTCP.h"


int
main (int argc, char *argv[])
{
  char buffer[1024];

  try {
        Communication *Server = new CommunicationTCP (2001);
        Communication *Client = Server->accept ();
        Client->receive (buffer, 1024);
        cout << "Server received: " << buffer << endl;
        delete Client; delete Server;
    } catch (Exception e) {
        cerr << "Exception: " << e.getMessage() << " Execution Aborted!\n";
        exit (1);
    } catch (...) {
        cerr << "General exception. Execution Aborted!\n";
        exit (1);
    }

  return 0;
}

