+ close(fd[0]);
+ close(fd[1]);
+
+ // SPTPS datagram authentication phase
+
+ if(socketpair(AF_UNIX, SOCK_DGRAM, 0, fd)) {
+ fprintf(stderr, "Could not create a UNIX socket pair: %s\n", sockstrerror(sockerrno));
+ return 1;
+ }
+
+ pfd[0].fd = fd[0], pfd[1].fd = fd[1];
+ params1.datagram = params2.datagram = true;
+
+ fprintf(stderr, "SPTPS/UDP authenticate for %lg seconds: ", duration);
+
+ for(clock_start(); clock_countto(duration);) {
+ sptps_start(&sptps1, ¶ms1);
+ sptps_start(&sptps2, ¶ms2);
+
+ while(poll(pfd, 2, 0)) {
+ if(pfd[0].revents) {
+ receive_data(&sptps1);
+ }
+
+ if(pfd[1].revents) {
+ receive_data(&sptps2);
+ }
+ }
+
+ sptps_stop(&sptps1);
+ sptps_stop(&sptps2);
+ }
+
+ fprintf(stderr, "%10.2lf op/s\n", rate * 2);
+
+ // SPTPS datagram data
+
+ sptps_start(&sptps1, ¶ms1);
+ sptps_start(&sptps2, ¶ms2);
+
+ while(poll(pfd, 2, 0)) {
+ if(pfd[0].revents) {
+ receive_data(&sptps1);
+ }
+
+ if(pfd[1].revents) {
+ receive_data(&sptps2);
+ }
+ }
+
+ fprintf(stderr, "SPTPS/UDP transmit for %lg seconds: ", duration);
+
+ for(clock_start(); clock_countto(duration);) {
+ if(!sptps_send_record(&sptps1, 0, buf1, 1451)) {
+ abort();
+ }