|
@@ -2,6 +2,7 @@
|
|
#include <boost/bind.hpp>
|
|
#include <boost/bind.hpp>
|
|
#include <boost/enable_shared_from_this.hpp>
|
|
#include <boost/enable_shared_from_this.hpp>
|
|
#include <iostream>
|
|
#include <iostream>
|
|
|
|
+#include <thread>
|
|
|
|
|
|
#include "../include/Sniffer.h"
|
|
#include "../include/Sniffer.h"
|
|
|
|
|
|
@@ -96,7 +97,7 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
const std::string interface = argv[1];
|
|
const std::string interface = argv[1];
|
|
Sniffer sniffer(interface);
|
|
Sniffer sniffer(interface);
|
|
- sniffer.startSniffing();
|
|
|
|
|
|
+ std::thread snifferThread(&Sniffer::startSniffing, sniffer);
|
|
|
|
|
|
try {
|
|
try {
|
|
io_service io_service;
|
|
io_service io_service;
|
|
@@ -105,5 +106,7 @@ int main(int argc, char *argv[]) {
|
|
} catch (std::exception &e) {
|
|
} catch (std::exception &e) {
|
|
std::cerr << e.what() << endl;
|
|
std::cerr << e.what() << endl;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ snifferThread.join();
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|