diff options
author | Christian Pointner <equinox@anytun.org> | 2010-01-13 01:39:43 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2010-01-13 01:39:43 +0000 |
commit | e28a27a8fd0d70d2aec48597991aa26003be1118 (patch) | |
tree | e6ae46558f78e0a36ee1b98459cef2f2f1387b58 /src/packetSource.h | |
parent | disables unsupported socket option on windows (diff) |
single thread per socket
Diffstat (limited to 'src/packetSource.h')
-rw-r--r-- | src/packetSource.h | 9 |
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 |