| | |
| | | |
| | | ShmSocket::~ShmSocket() |
| | | { |
| | | Stop(); |
| | | Stop(); //TODO should stop in sub class, incase thread access sub class data. |
| | | } |
| | | |
| | | bool ShmSocket::StartRaw(const RecvRawCB &onData, int nworker) |
| | |
| | | |
| | | bool ShmSocket::SyncSend(const void *id, const bhome_msg::BHMsg &msg, const int timeout_ms) |
| | | { |
| | | std::lock_guard<std::mutex> lock(mutex_); |
| | | if (!mq_ || RunningNoLock()) { |
| | | return false; |
| | | } else { |
| | | return mq_->Send(*static_cast<const MQId *>(id), msg, timeout_ms); |
| | | } |
| | | return mq_->Send(*static_cast<const MQId *>(id), msg, timeout_ms); |
| | | } |
| | | |
| | | bool ShmSocket::SyncRecv(bhome_msg::BHMsg &msg, const int timeout_ms) |