205 |
//Now let's deliver late notifies (if any) |
//Now let's deliver late notifies (if any) |
206 |
NotifyBufferMutex.Lock(); |
NotifyBufferMutex.Lock(); |
207 |
for (std::map<int,String>::iterator iterNotify = bufferedNotifies.begin(); iterNotify != bufferedNotifies.end(); iterNotify++) { |
for (std::map<int,String>::iterator iterNotify = bufferedNotifies.begin(); iterNotify != bufferedNotifies.end(); iterNotify++) { |
208 |
send(iterNotify->first, iterNotify->second.c_str(), iterNotify->second.size(), 0); |
send(iterNotify->first, iterNotify->second.c_str(), iterNotify->second.size(), MSG_NOSIGNAL); |
209 |
bufferedNotifies.erase(iterNotify); |
bufferedNotifies.erase(iterNotify); |
210 |
} |
} |
211 |
NotifyBufferMutex.Unlock(); |
NotifyBufferMutex.Unlock(); |
255 |
while (true) { |
while (true) { |
256 |
if (NotifyMutex.Trylock()) { |
if (NotifyMutex.Trylock()) { |
257 |
for(;iter != end; iter++) |
for(;iter != end; iter++) |
258 |
send(*iter, notify.c_str(), notify.size(), 0); |
send(*iter, notify.c_str(), notify.size(), MSG_NOSIGNAL); |
259 |
NotifyMutex.Unlock(); |
NotifyMutex.Unlock(); |
260 |
break; |
break; |
261 |
} else { |
} else { |
364 |
dmsg(2,("LSCPServer::AnswerClient(ReturnMessage=%s)", ReturnMessage.c_str())); |
dmsg(2,("LSCPServer::AnswerClient(ReturnMessage=%s)", ReturnMessage.c_str())); |
365 |
if (currentSocket != -1) { |
if (currentSocket != -1) { |
366 |
NotifyMutex.Lock(); |
NotifyMutex.Lock(); |
367 |
send(currentSocket, ReturnMessage.c_str(), ReturnMessage.size(), 0); |
send(currentSocket, ReturnMessage.c_str(), ReturnMessage.size(), MSG_NOSIGNAL); |
368 |
NotifyMutex.Unlock(); |
NotifyMutex.Unlock(); |
369 |
} |
} |
370 |
} |
} |