Skip to content

Commit 07f6de4

Browse files
committedJun 22, 2016
Changed command-line input params
1 parent 61093ab commit 07f6de4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
 

‎receiver.cc

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <cassert>
22
#include <chrono>
3+
#include <cstdlib>
34
#include <iostream>
45
#include <mutex>
56
#include <string.h>
@@ -93,15 +94,13 @@ void echo_packets(UDPSocket &sender_socket) {
9394
}
9495
}
9596

96-
int main(int argc __attribute((unused)), char* argv[] __attribute((unused))) {
97-
// if (argc != 2) {
98-
// cout << "Please specify the IP address of the NAT server" << endl;
99-
// return 0;
100-
// }
101-
//string nat_ip_addr = argv[1];
97+
int main(int argc, char* argv[]) {
98+
int port = 8888;
99+
if (argc == 2)
100+
port = atoi(argv[1]);
102101

103102
UDPSocket sender_socket;
104-
sender_socket.bindsocket(8888);
103+
sender_socket.bindsocket(port);
105104

106105
//thread nat_thread(punch_NAT, nat_ip_addr, ref(sender_socket));
107106
echo_packets(sender_socket);

‎sender.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int main( int argc, char *argv[] ) {
105105
}
106106

107107
if ( serverip == "" ) {
108-
fprintf( stderr, "Usage: sender serverip=(ipaddr) [if=(ratname)] [offduration=(time in ms)] [onduration=(time in ms)] [cctype=remy|kernel|tcp|markovian] [delta_conf=(for MarkovianCC)] [linkrate=(packets/sec)] [linklog=filename] [serverport=(port)]\n");
108+
fprintf( stderr, "Usage: sender serverip=(ipaddr) [if=(ratname)] [offduration=(time in ms)] [onduration=(time in ms)] [cctype=remy|kernel|tcp|markovian] [delta_conf=(for MarkovianCC)] [traffic_params=[exponential|deterministic],[byte_switched],[num_cycles=]] [linkrate=(packets/sec)] [linklog=filename] [serverport=(port)]\n");
109109
exit(1);
110110
}
111111

0 commit comments

Comments
 (0)
Please sign in to comment.