45 {
46 std::set<UDTSOCKET> read_ready;
47 std::set<UDTSOCKET> write_ready;
48 while( !_epoll_loop.canceled() )
49 {
50 UDT::epoll_wait( _epoll_id,
51 &read_ready,
52 &write_ready, 100000000 );
53
54 { synchronized(_read_promises_mutex)
55 for( auto sock : read_ready )
56 {
57 auto itr = _read_promises.find( sock );
58 if( itr != _read_promises.end() )
59 {
60 itr->second->set_value();
61 _read_promises.erase(itr);
62 }
63 }
64 }
65
66 { synchronized(_write_promises_mutex)
67 for( auto sock : write_ready )
68 {
69 auto itr = _write_promises.find( sock );
70 if( itr != _write_promises.end() )
71 {
72 itr->second->set_value();
73 _write_promises.erase(itr);
74 }
75 }
76 }
77 }
78 }