#include #include #include #include #include #include #include #include using namespace ::std; unsigned int msg_length_max = 20000000; int main(int argc, char* argv[]) try { char* endptr = 0; long elements; if (argc > 1) { elements = strtol(argv[1], &endptr, 10); } else { elements = 70000; } list lst; list lst2; for (int j = 1; j <= elements; ++j) { lst.push_back(j); } SendBufferFile sendbuf; ReceiveBufferFile buf(3000000); sendbuf.hndl = buf.hndl = file_open("eeout"); Msgs msgs(30000000); msgs.Marshal(sendbuf, lst); sendbuf.Flush(); lseek(buf.hndl, 0, SEEK_SET); timeval before_tv, after_tv; struct timezone tz; gettimeofday(&before_tv, &tz); buf.GotPacket(); msgs.Receive(buf, lst2); gettimeofday(&after_tv, &tz); if (before_tv.tv_sec != after_tv.tv_sec) { after_tv.tv_usec += 1000000; } long diff = after_tv.tv_usec - before_tv.tv_usec; cout << "Input took (microseconds) " << diff << endl; if (lst != lst2) { cout << "The two lists are not logically equivalent." << endl; } return 1; } catch (failure const & ex) { cout << "failure exception: " << ex.what(); }