commit 0f656f634f131fbbd4923368ba8674f1e3200481
parent 1b62f7e2901c3c65b0dc55420928ab0034e12ad2
Author: Bharatvaj H <bharatvajph@gmail.com>
Date: Sun, 10 Mar 2019 15:19:46 +0000
parent 1b62f7e2901c3c65b0dc55420928ab0034e12ad2
Author: Bharatvaj H <bharatvajph@gmail.com>
Date: Sun, 10 Mar 2019 15:19:46 +0000
Added test discovery for left and right adapters
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/forwarder.cpp b/forwarder.cpp @@ -64,11 +64,19 @@ int main(int argc, char *argv[]) l = getNetwork("Enter the name of the left device: "); r = getNetwork("Enter the name of the right device: "); + thread *t = new thread([](){ + cerr << "Debug Information" << endl; auto v = l->discover(); - cout << "Discovered" << endl; + cout << l->getUserFriendlyName() << " discovers" << endl; for (NetworkInfo s : v){ - cout << s.name << " : " << s.address << endl; + cerr << s.name << " : " << s.address << endl; } + v = r->discover(); + cout << r->getUserFriendlyName() << " discovers" << endl; + for (NetworkInfo s : v){ + cerr << s.name << " : " << s.address << endl; + } + }); //Wait for the initiators to connect Connector c = Connector(*l, *r); @@ -79,5 +87,6 @@ int main(int argc, char *argv[]) }); c.start(); while (1); + t->join(); return 0; }
: bharatvaj/forwarder