Exemple #1
0
int main()
{
    signal(SIGPIPE, sigHandler);
    signal(SIGHUP, sigHandler);
    Transport gClientTrans;
    gClientTrans.start();
    
    EchoServer server;
    server.start();

    for (int i = 0; i < 1; i++)
    {
        EchoClient* client = new EchoClient;        
        client->mClientTrans = &gClientTrans;
        cout << "Round " << i << endl;
        client->Run();
        usleep(100000);
        waitpid(-1, NULL, WNOHANG);
    }
    gClientTrans.stop();
    gClientTrans.wait();
    server.stop();
}
Exemple #2
0
int main(int argc, char **argv)
{
    EchoServer server;
    server.start();
    return 0;
}