| 107 | } |
| 108 | |
| 109 | void TCPTalker::safeDispatch(function<void()> hdl) { |
| 110 | try { |
| 111 | sktMtx.lock(); |
| 112 | if (_skt) { |
| 113 | bool done = false; |
| 114 | _skt->get_io_service().dispatch([&] { |
| 115 | hdl(); |
| 116 | done = true; |
| 117 | }); |
| 118 | while (!done) |
| 119 | sleep_for(milliseconds(10)); |
| 120 | } |
| 121 | sktMtx.unlock(); |
| 122 | } catch (exception &e) { |
| 123 | PVR_DB_I("[TCPTalker::safeDispatch] Exception caught: " + string(e.what())); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | bool TCPTalker::send(PVR_MSG msgType, vector<uint8_t> data) { |
| 128 | vector<uint8_t> buf = {'p', 'v', 'r', (uint8_t) msgType, 0, 0}; |
nothing calls this directly
no outgoing calls
no test coverage detected