diff --git a/examples/bench_17/main.c b/examples/bench_17/main.c index 7aa019f570eb5a8d5977de40ec2df367157c4aee..9d92da758a67207d8dcf32880703db7d553f1896 100644 --- a/examples/bench_17/main.c +++ b/examples/bench_17/main.c @@ -1,61 +1,42 @@ #include #include "../../reowolf.h" #include "../utility.c" -#define N 5 int main(int argc, char** argv) { - int i, cid, min_pid, msgs; + int i, j, cid, min_putter, min_getter, ports_tot, ports_used; + char do_puts, do_gets; cid = atoi(argv[1]); - min_pid = atoi(argv[2]); - char role = argv[3][0]; // 'h' for head, 'i' for inner, 't' for tail, 's' for singleton - msgs = atoi(argv[4]); - printf("cid %d, min_pid %d, role='%c', msgs %d\n", - cid, min_pid, role, msgs); + min_putter = atoi(argv[2]); + min_getter = atoi(argv[3]); + ports_tot = atoi(argv[4]); + ports_used = atoi(argv[5]); + do_puts = argv[6][0]; // 't' or 'f' + do_gets = argv[7][0]; + printf("cid %d, min_putter %d, min_getter %d, ports_tot %d, ports_used %d, do_puts %c, do_gets %c\n", + cid, min_putter, min_getter, ports_tot, ports_used, do_puts, do_gets); printf("Error str `%s`\n", reowolf_error_peek(NULL)); unsigned char pdl[] = ""; Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); Connector * c = connector_new_with_id(pd, cid); - PortId putters[N], getters[N]; - FfiSocketAddr addr = {{127, 0, 0, 1}, 0}; - if(role=='i' || role=='t') { - // I have N getter ports! - for(i=0; i +#include "../../reowolf.h" +#include "../utility.c" +int main(int argc, char** argv) { + // all outward connections are ACTIVE to localhost + // use tcp_rendezvous + int i, j, cid, min_putter, min_getter, ports_tot, ports_used; + char do_puts, do_gets; + cid = atoi(argv[1]); + min_putter = atoi(argv[2]); + min_getter = atoi(argv[3]); + ports_tot = atoi(argv[4]); + ports_used = atoi(argv[5]); + do_puts = argv[6][0]; // 't' or 'f' + do_gets = argv[7][0]; + printf("cid %d, min_putter %d, min_getter %d, ports_tot %d, ports_used %d, do_puts %c, do_gets %c\n", + cid, min_putter, min_getter, ports_tot, ports_used, do_puts, do_gets); + printf("Error str `%s`\n", reowolf_error_peek(NULL)); + + unsigned char pdl[] = ""; + Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); + Connector * c = connector_new_with_id(pd, cid); + PortId putters[ports_tot], getters[ports_tot]; + for(i=0; i +#include "../../reowolf.h" +#include "../utility.c" +int main(int argc, char** argv) { + // bounce off tokyo to my public IP + int i, j, cid, min_putter, min_getter, ports_tot, ports_used, n_rounds; + char do_puts, do_gets; + cid = atoi(argv[1]); + min_putter = atoi(argv[2]); + min_getter = atoi(argv[3]); + ports_tot = atoi(argv[4]); + ports_used = atoi(argv[5]); + do_puts = argv[6][0]; // 't' or 'f' + do_gets = argv[7][0]; + n_rounds = atoi(argv[12]); + + // argv 8..12 is PEER_IP + + printf("cid %d, min_putter %d, min_getter %d, ports_tot %d, ports_used %d, do_puts %c, do_gets %c, n_rounds %d\n", + cid, min_putter, min_getter, ports_tot, ports_used, do_puts, do_gets, n_rounds); + printf("peer_ip %d.%d.%d.%d\n", + atoi(argv[8]), + atoi(argv[9]), + atoi(argv[10]), + atoi(argv[11])); + + printf("Error str `%s`\n", reowolf_error_peek(NULL)); + + unsigned char pdl[] = ""; + Arc_ProtocolDescription * pd = protocol_description_parse(pdl, sizeof(pdl)-1); + Connector * c = connector_new_with_id(pd, cid); + PortId putters[ports_tot], getters[ports_tot]; + for(i=0; i