summaryrefslogtreecommitdiff
path: root/src/packetSource.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2010-01-13 01:39:43 +0000
committerChristian Pointner <equinox@anytun.org>2010-01-13 01:39:43 +0000
commite28a27a8fd0d70d2aec48597991aa26003be1118 (patch)
treee6ae46558f78e0a36ee1b98459cef2f2f1387b58 /src/packetSource.h
parentdisables unsupported socket option on windows (diff)
single thread per socket
Diffstat (limited to 'src/packetSource.h')
-rw-r--r--src/packetSource.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/packetSource.h b/src/packetSource.h
index ceac34b..da90690 100644
--- a/src/packetSource.h
+++ b/src/packetSource.h
@@ -34,6 +34,7 @@
#define ANYTUN_packetSource_h_INCLUDED
#include <boost/asio.hpp>
+#include <boost/thread.hpp>
#include <list>
#include <queue>
@@ -79,21 +80,19 @@ private:
u_int8_t* buf_;
u_int32_t len_;
proto::socket* sock_;
+ Semaphore* sem_;
} sockets_element_t;
std::list<sockets_element_t> sockets_;
+ void recv_thread(std::list<sockets_element_t>::iterator it);
typedef struct {
- u_int8_t* buf_;
u_int32_t len_;
- proto::socket* sock_;
PacketSourceEndpoint remote_;
+ std::list<sockets_element_t>::iterator it_;
} thread_result_t;
std::queue<thread_result_t> thread_result_queue_;
Mutex thread_result_mutex_;
Semaphore thread_result_sem_;
- sockets_element_t last_recv_sock_;
-
- void recv_thread(thread_result_t result);
};
#endif