mirror of
https://github.com/glest/glest-source.git
synced 2025-10-03 19:01:53 +02:00
- a bold attempt to push the socket read threads to read continuously to see if this is:
a) stable without causing out of synch b) not too hard on the CPU
This commit is contained in:
@@ -108,7 +108,24 @@ void NetworkInterface::DisplayErrorMessage(string sErr, bool closeSocket) {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<ChatMsgInfo> NetworkInterface::getChatTextList(bool clearAfterRetrieve) {
|
||||
std::vector<ChatMsgInfo> result;
|
||||
MutexSafeWrapper safeMutex(&mutexChatTextList,CODE_AT_LINE);
|
||||
result = chatTextList;
|
||||
if(clearAfterRetrieve == true) {
|
||||
chatTextList.clear();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void NetworkInterface::addChatInfo(const ChatMsgInfo &msg) {
|
||||
MutexSafeWrapper safeMutex(&mutexChatTextList,CODE_AT_LINE);
|
||||
chatTextList.push_back(msg);
|
||||
}
|
||||
|
||||
void NetworkInterface::clearChatInfo() {
|
||||
MutexSafeWrapper safeMutex(&mutexChatTextList,CODE_AT_LINE);
|
||||
if(chatTextList.empty() == false) {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] chatTextList.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,chatTextList.size());
|
||||
chatTextList.clear();
|
||||
|
Reference in New Issue
Block a user