forked from augcampos/asterisk-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWriter.cpp
More file actions
34 lines (25 loc) · 695 Bytes
/
Writer.cpp
File metadata and controls
34 lines (25 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* Writer.cpp
*
* Created on: Jul 7, 2011
* Author: augcampos
*/
#include "asteriskcpp/manager/Writer.h"
#include "asteriskcpp/utils/LogHandler.h"
#include "asteriskcpp/utils/StringUtils.h"
namespace asteriskcpp {
Writer::Writer() {
}
Writer::~Writer() {
}
void Writer::start(TCPSocket* s, SynchronisedQueue<std::string>* wq) {
m_connectionSocket = s;
m_WriteQueue = wq;
Thread::start();
}
void Writer::run() {
std::string s_data = m_WriteQueue->Dequeue();
LOG_DEBUG_DATA("[SND:" << str2Log(s_data) << ":SND]");
m_connectionSocket->writeData(s_data.c_str(), (unsigned int) s_data.size());
}
}