Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ( 1 )
- {
- if ( m_tcp_sender != NULL )
- // start waiting for new tcp connection
- m_tcp_sender->initialize();
- bool session_running = true;
- while ( session_running )
- {
- ...
- boost::thread t( &tcp_sender::send_thread, m_tcp_sender );
- if ( !t.timed_join( boost::posix_time::milliseconds( 2000 ) ) )
- {
- session_running = false;
- }
- else if ( !m_tcp_sender->data_sent() )
- session_running = false;
- ....
- }
- if ( m_tcp_sender != NULL )
- // closes tcp socket ( drops connection )
- m_tcp_sender->deinitialize();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement