#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "RHexCom.hh" int main(int argc, char** argv) { if (argc != 4) { fprintf(stderr, "Usage: ping_test <port> <dest_machine> <dest_port>\n"); exit(-1); } unsigned short port = atoi(argv[1]); CommManager* mgr = new CommManager(port); RemoteManager* remote = mgr->openRemote(argv[2], atoi(argv[3])); remote->setTimeStamp(CommManager::now()); // kick off the ping while (1) { printf("Last contacted %d\n", remote->lastContactTime()); sleep(1); } delete mgr; }