Rev | Line | |
---|
[22] | 1 | /** |
---|
| 2 | * @file TcpipDispatch.cpp |
---|
| 3 | * @author Tomas Urban |
---|
| 4 | * @version 0.2 |
---|
| 5 | * @date 23/07/2009 |
---|
| 6 | */ |
---|
| 7 | #include "TcpipDispatch.h" |
---|
| 8 | #include "Logger/Logger.h" |
---|
| 9 | |
---|
| 10 | TcpipDispatch::TcpipDispatch(SOCKET_TYPE hSocket) |
---|
| 11 | { |
---|
| 12 | m_hSocket = hSocket; |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | TcpipDispatch::~TcpipDispatch(void) |
---|
| 16 | { |
---|
| 17 | Stop(); |
---|
| 18 | } |
---|
| 19 | |
---|
| 20 | void TcpipDispatch::Stop() |
---|
| 21 | { |
---|
| 22 | m_hSocket = 0; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | void TcpipDispatch::DispatchData(CapturedData * pData) |
---|
| 26 | { |
---|
| 27 | if (m_hSocket) |
---|
| 28 | { |
---|
| 29 | { |
---|
| 30 | boost::mutex::scoped_lock lock(m_mutex); |
---|
| 31 | // send data |
---|
| 32 | send(m_hSocket, pData->GetEncodedMessage(), pData->GetEncodedDataLength(), 0); |
---|
| 33 | } |
---|
| 34 | Logger::Instance().LogCapture(pData->ToString()); |
---|
| 35 | } |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.