5 #ifndef __DDS__BaseChannelImpl__ 6 #define __DDS__BaseChannelImpl__ 14 #include <boost/noncopyable.hpp> 15 #pragma clang diagnostic push 16 #pragma clang diagnostic ignored "-Wunused-local-typedef" 17 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 18 #include <boost/asio.hpp> 19 #pragma clang diagnostic pop 21 #pragma clang diagnostic push 22 #pragma clang diagnostic ignored "-Wdeprecated-register" 23 #include <boost/uuid/uuid.hpp> 24 #include <boost/uuid/uuid_generators.hpp> 25 #include <boost/uuid/uuid_io.hpp> 26 #pragma clang diagnostic pop 37 namespace protocol_api
46 #define BEGIN_MSG_MAP(theClass) \ 48 friend protocol_api::CBaseChannelImpl<theClass>; \ 49 friend protocol_api::CClientChannelImpl<theClass>; \ 50 friend protocol_api::CServerChannelImpl<theClass>; \ 51 void processMessage(protocol_api::CProtocolMessage::protocolMessagePtr_t _currentMsg) \ 53 using namespace dds; \ 54 using namespace dds::protocol_api; \ 55 CMonitoringThread::instance().updateIdle(); \ 56 bool processed = true; \ 57 ECmdType currentCmd = static_cast<ECmdType>(_currentMsg->header().m_cmd); \ 63 case cmdBINARY_ATTACHMENT: \ 65 typedef typename SCommandAttachmentImpl<cmdBINARY_ATTACHMENT>::ptr_t attahcmentPtr_t; \ 66 attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<cmdBINARY_ATTACHMENT>::decode(_currentMsg); \ 67 processBinaryAttachmentCmd(attachmentPtr); \ 70 case cmdBINARY_ATTACHMENT_START: \ 72 typedef typename SCommandAttachmentImpl<cmdBINARY_ATTACHMENT_START>::ptr_t attahcmentPtr_t; \ 73 attahcmentPtr_t attachmentPtr = \ 74 SCommandAttachmentImpl<cmdBINARY_ATTACHMENT_START>::decode(_currentMsg); \ 75 processBinaryAttachmentStartCmd(attachmentPtr); \ 80 SCommandAttachmentImpl<cmdHANDSHAKE>::ptr_t attachmentPtr = \ 81 SCommandAttachmentImpl<cmdHANDSHAKE>::decode(_currentMsg); \ 82 dispatchMessageHandlers(currentCmd, attachmentPtr, this); \ 85 case cmdREPLY_HANDSHAKE_OK: \ 87 SCommandAttachmentImpl<cmdREPLY_HANDSHAKE_OK>::ptr_t attachmentPtr = \ 88 SCommandAttachmentImpl<cmdREPLY_HANDSHAKE_OK>::decode(_currentMsg); \ 89 dispatchMessageHandlers(currentCmd, attachmentPtr, this); \ 92 case cmdREPLY_HANDSHAKE_ERR: \ 94 SCommandAttachmentImpl<cmdREPLY_HANDSHAKE_ERR>::ptr_t attachmentPtr = \ 95 SCommandAttachmentImpl<cmdREPLY_HANDSHAKE_ERR>::decode(_currentMsg); \ 96 dispatchMessageHandlers(currentCmd, attachmentPtr, this); \ 100 #define MESSAGE_HANDLER(msg, func) \ 103 typedef typename SCommandAttachmentImpl<msg>::ptr_t attahcmentPtr_t; \ 104 attahcmentPtr_t attachmentPtr = SCommandAttachmentImpl<msg>::decode(_currentMsg); \ 105 LOG(MiscCommon::debug) << "Processing " << g_cmdToString[msg] << " received from " << remoteEndIDString(); \ 106 processed = func(attachmentPtr); \ 109 if (getNofMessageHandlers<msg>() == 0) \ 111 LOG(MiscCommon::error) << "The received message was not processed and has no registered handler: " \ 112 << _currentMsg->toString(); \ 116 dispatchMessageHandlers(msg, attachmentPtr, this); \ 122 #define END_MSG_MAP() \ 124 LOG(MiscCommon::error) << "The received message doesn't have a handler: " << _currentMsg->toString(); \ 127 catch (std::exception & _e) \ 129 LOG(MiscCommon::error) << "Channel processMessage: " << _e.what(); \ 133 #define REGISTER_DEFAULT_REMOTE_ID_STRING \ 134 std::string _remoteEndIDString() \ 136 return "DDS Server"; \ 141 namespace protocol_api
153 {
"unknown",
"agent",
"ui",
"key_value_guard",
"custom_command_guard" }
183 public std::enable_shared_from_this<T>,
186 typedef std::function<void(T*)> handlerDisconnectEventFunction_t;
187 typedef std::deque<CProtocolMessage::protocolMessagePtr_t> protocolMessagePtrQueue_t;
188 typedef std::vector<boost::asio::mutable_buffer> protocolMessageBuffer_t;
189 typedef std::shared_ptr<boost::asio::deadline_timer> deadlineTimerPtr_t;
202 , m_isHandshakeOK(
false)
204 , m_io_service(_service)
207 , m_currentMsg(std::make_shared<CProtocolMessage>())
208 , m_binaryAttachmentMap()
209 , m_binaryAttachmentMutex()
211 std::make_shared<boost::asio::deadline_timer>(_service, boost::posix_time::milliseconds(1000)))
212 , m_isShuttingDown(
false)
223 static connectionPtr_t
makeNew(boost::asio::io_service& _service)
225 connectionPtr_t newObject(
new T(_service));
232 return m_isHandshakeOK;
237 return m_channelType;
242 m_channelType = _channelType;
253 ::fcntl(m_socket.native_handle(), F_SETFD, FD_CLOEXEC);
270 template <ECmdType _cmd>
273 std::lock_guard<std::mutex> lock(m_mutexWriteBuffer);
274 m_writeQueue.erase(std::remove_if(std::begin(m_writeQueue),
275 std::end(m_writeQueue),
277 return (_msg->header().m_cmd == _cmd);
279 std::end(m_writeQueue));
282 template <ECmdType _cmd,
class A>
285 static const size_t maxAccumulativeWriteQueueSize = 10000;
290 bool copyMessages =
false;
292 std::lock_guard<std::mutex> lock(m_mutexWriteBuffer);
294 m_deadlineTimer->cancel();
297 m_accumulativeWriteQueue.push_back(msg);
299 copyMessages = m_accumulativeWriteQueue.size() > maxAccumulativeWriteQueueSize;
303 <<
"copy accumulated queue to write queue " 304 "m_accumulativeWriteQueue.size=" 305 << m_accumulativeWriteQueue.size() <<
" m_writeQueue.size=" << m_writeQueue.size();
308 std::copy(m_accumulativeWriteQueue.begin(),
309 m_accumulativeWriteQueue.end(),
310 back_inserter((m_isHandshakeOK) ? m_writeQueue : m_writeQueueBeforeHandShake));
311 m_accumulativeWriteQueue.clear();
314 auto self(this->shared_from_this());
315 m_deadlineTimer->async_wait([
this,
self](
const boost::system::error_code& error) {
318 bool copyMessages =
false;
320 std::lock_guard<std::mutex> lock(m_mutexWriteBuffer);
321 copyMessages = !m_accumulativeWriteQueue.empty();
326 <<
"deadline_timer called: copy accumulated queue to write queue " 327 "m_accumulativeWriteQueue.size=" 328 << m_accumulativeWriteQueue.size()
329 <<
" m_writeQueue.size=" << m_writeQueue.size();
330 std::copy(m_accumulativeWriteQueue.begin(),
331 m_accumulativeWriteQueue.end(),
332 back_inserter((m_isHandshakeOK) ? m_writeQueue
333 : m_writeQueueBeforeHandShake));
334 m_accumulativeWriteQueue.clear();
338 pushMsg<cmdUNKNOWN>();
343 <<
" WriteQueueBeforeHandShake = " << m_writeQueueBeforeHandShake.size()
344 <<
" accumulativeWriteQueue size = " << m_accumulativeWriteQueue.size()
345 <<
" attachment = " << _attachment;
348 pushMsg<cmdUNKNOWN>();
350 catch (std::exception& ex)
356 template <ECmdType _cmd>
360 accumulativePushMsg<_cmd>(cmd);
363 template <ECmdType _cmd,
class A>
370 std::lock_guard<std::mutex> lock(m_mutexWriteBuffer);
371 if (!m_isHandshakeOK)
373 if (isCmdAllowedWithoutHandshake(_cmd))
374 m_writeQueue.push_back(msg);
376 m_writeQueueBeforeHandShake.push_back(msg);
381 if (!m_writeQueueBeforeHandShake.empty())
383 std::copy(m_writeQueueBeforeHandShake.begin(),
384 m_writeQueueBeforeHandShake.end(),
385 back_inserter(m_writeQueue));
386 m_writeQueueBeforeHandShake.clear();
391 m_writeQueue.push_back(msg);
395 <<
" WriteQueueBeforeHandShake = " << m_writeQueueBeforeHandShake.size();
397 catch (std::exception& ex)
403 auto self(this->shared_from_this());
404 m_io_service.post([
this,
self] {
409 catch (std::exception& ex)
416 template <ECmdType _cmd>
423 template <ECmdType _cmd,
class A>
428 T* pThis =
static_cast<T*
>(
this);
429 pThis->processMessage(msg);
432 template <ECmdType _cmd>
436 sendYourself<_cmd>(cmd);
440 const std::string& _fileName,
445 std::string srcFilePath(_srcFilePath);
449 std::ifstream f(srcFilePath);
450 if (!f.is_open() || !f.good())
452 throw std::runtime_error(
"Could not open the source file: " + srcFilePath);
454 f.seekg(0, std::ios::end);
455 data.reserve(f.tellg());
456 f.seekg(0, std::ios::beg);
457 data.assign((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
459 pushBinaryAttachmentCmd(data, _fileName, _cmdSource);
463 const std::string& _fileName,
466 static const int maxCommandSize = 65536;
467 int nofParts = (_data.size() % maxCommandSize == 0) ? (_data.size() / maxCommandSize)
468 : (_data.size() / maxCommandSize + 1);
469 boost::crc_32_type fileCrc32;
470 fileCrc32.process_bytes(&_data[0], _data.size());
472 boost::uuids::uuid fileId = boost::uuids::random_generator()();
481 pushMsg<cmdBINARY_ATTACHMENT_START>(start_cmd);
483 for (
size_t i = 0; i < nofParts; ++i)
488 size_t offset = i * maxCommandSize;
489 size_t size = (i != (nofParts - 1)) ? maxCommandSize : (_data.size() - offset);
491 auto iter_begin = _data.begin() + offset;
492 auto iter_end = iter_begin + size;
493 std::copy(iter_begin, iter_end, std::back_inserter(cmd.
m_data));
498 boost::crc_32_type crc32;
499 crc32.process_bytes(&(*iter_begin), size);
501 cmd.
m_crc32 = crc32.checksum();
503 pushMsg<cmdBINARY_ATTACHMENT>(cmd);
509 boost::uuids::uuid fileId = _attachment->m_fileId;
513 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
515 binaryAttachmentMap_t::iterator iter_info = m_binaryAttachmentMap.find(fileId);
516 bool exists = iter_info != m_binaryAttachmentMap.end();
520 m_binaryAttachmentMap[fileId] = std::make_shared<SBinaryAttachmentInfo>();
521 iter_info = m_binaryAttachmentMap.find(fileId);
522 iter_info->second->m_startTime = std::chrono::steady_clock::now();
523 iter_info->second->m_fileName = _attachment->m_fileName;
524 iter_info->second->m_fileSize = _attachment->m_fileSize;
525 iter_info->second->m_fileCrc32 = _attachment->m_fileCrc32;
526 iter_info->second->m_srcCommand = _attachment->m_srcCommand;
527 iter_info->second->m_data.resize(_attachment->m_fileSize);
534 boost::uuids::uuid fileId = _attachment->m_fileId;
535 binaryAttachmentInfoPtr_t info;
536 binaryAttachmentMap_t::iterator iter_info;
540 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
542 iter_info = m_binaryAttachmentMap.find(fileId);
543 bool exists = iter_info != m_binaryAttachmentMap.end();
548 <<
"Received binary attachment [" << fileId <<
"] which does not exist. Skip this message.";
551 info = iter_info->second;
554 boost::crc_32_type crc32;
555 crc32.process_bytes(&_attachment->m_data[0], _attachment->m_data.size());
557 if (crc32.checksum() != _attachment->m_crc32)
561 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
563 m_binaryAttachmentMap.erase(iter_info);
565 std::stringstream ss;
566 ss <<
"Received binary attachment [" << fileId <<
"] has wrong CRC32 checksum: " << crc32.checksum()
567 <<
" instead of " << _attachment->m_crc32 <<
"offset=" << _attachment->m_offset
568 <<
" size=" << _attachment->m_size;
574 bool allBytesReceived =
false;
577 std::lock_guard<std::mutex> lock(info->m_mutex);
579 info->m_bytesReceived += _attachment->m_size;
581 std::copy(_attachment->m_data.begin(),
582 _attachment->m_data.end(),
583 info->m_data.begin() + _attachment->m_offset);
585 allBytesReceived = info->m_bytesReceived == info->m_fileSize;
586 if (allBytesReceived)
589 boost::crc_32_type crc32;
590 crc32.process_bytes(&info->m_data[0], info->m_data.size());
592 if (crc32.checksum() != info->m_fileCrc32)
596 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
598 m_binaryAttachmentMap.erase(iter_info);
600 std::stringstream ss;
601 ss <<
"Received binary file [" << fileId
602 <<
"] has wrong CRC32 checksum: " << crc32.checksum() <<
" instead of " 603 << _attachment->m_crc32;
610 const std::string fileName(dir + to_string(fileId));
611 std::ofstream f(fileName.c_str());
612 if (!f.is_open() || !f.good())
616 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
618 m_binaryAttachmentMap.erase(iter_info);
620 std::stringstream ss;
621 ss <<
"Could not open file: " << fileName;
627 for (
const auto& v : info->m_data)
633 std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
634 std::chrono::microseconds downloadTime =
635 std::chrono::duration_cast<std::chrono::microseconds>(now - info->m_startTime);
640 reply_cmd.m_requestedFileName = info->m_fileName;
641 reply_cmd.m_srcCommand = info->m_srcCommand;
642 reply_cmd.m_downloadTime = downloadTime.count();
643 reply_cmd.m_receivedFileSize = info->m_fileSize;
644 sendYourself<cmdBINARY_ATTACHMENT_RECEIVED>(reply_cmd);
648 if (allBytesReceived)
651 std::lock_guard<std::mutex> lock(m_binaryAttachmentMutex);
653 m_binaryAttachmentMap.erase(iter_info);
659 m_disconnectEventHandler = _handler;
672 T* pThis =
static_cast<T*
>(
this);
673 std::stringstream ss;
674 ss << pThis->_remoteEndIDString() <<
" [" << socket().remote_endpoint().address().to_string()
680 return std::string();
687 auto self(this->shared_from_this());
688 boost::asio::async_read(
691 [
this,
self](boost::system::error_code ec, std::size_t length) {
697 if (!ec && m_currentMsg->decode_header())
702 else if ((boost::asio::error::eof == ec) || (boost::asio::error::connection_reset == ec))
705 <<
"Disconnect is detected while on read msg header: " << ec.message();
714 "closing the connection: " 724 if (m_currentMsg->body_length() == 0)
727 <<
": no attachment: " << m_currentMsg->toString();
729 T* pThis =
static_cast<T*
>(
this);
730 pThis->processMessage(m_currentMsg);
733 this->logReadMessage(m_currentMsg);
736 m_currentMsg->clear();
741 auto self(this->shared_from_this());
742 boost::asio::async_read(
744 boost::asio::buffer(m_currentMsg->body(), m_currentMsg->body_length()),
745 [
this,
self](boost::system::error_code ec, std::size_t length) {
749 << length <<
" bytes): " << m_currentMsg->toString();
752 T* pThis =
static_cast<T*
>(
this);
753 pThis->processMessage(m_currentMsg);
756 this->logReadMessage(m_currentMsg);
759 m_currentMsg->clear();
762 else if ((boost::asio::error::eof == ec) || (boost::asio::error::connection_reset == ec))
774 "closing the connection: " 788 std::lock_guard<std::mutex> lockWriteBuffer(m_mutexWriteBuffer);
789 if (!m_writeBuffer.empty())
792 if (m_writeQueue.empty())
795 for (
auto i : m_writeQueue)
798 <<
"Sending to " << remoteEndIDString() <<
" a message: " << i->toString();
800 m_isShuttingDown =
true;
801 m_writeBuffer.push_back(boost::asio::buffer(i->data(), i->length()));
802 m_writeBufferQueue.push_back(i);
804 m_writeQueue.clear();
807 auto self(this->shared_from_this());
808 boost::asio::async_write(
811 [
this,
self](boost::system::error_code _ec, std::size_t _bytesTransferred) {
817 << _bytesTransferred <<
" bytes)";
819 if (m_isShuttingDown)
822 <<
"Shutdown signal has been successfully sent to " << remoteEndIDString();
828 std::lock_guard<std::mutex> lock(m_mutexWriteBuffer);
831 this->logWriteMessages(m_writeBufferQueue);
833 m_writeBuffer.clear();
834 m_writeBufferQueue.clear();
839 else if ((boost::asio::error::eof == _ec) || (boost::asio::error::connection_reset == _ec))
842 <<
"Disconnect is detected while on write message: " << _ec.message();
850 <<
"Error sending to " << remoteEndIDString() <<
": " << _ec.message();
853 <<
"The stop signal is received, aborting current operation and " 854 "closing the connection: " 859 catch (std::exception& ex)
868 LOG(
MiscCommon::debug) <<
"The session was disconnected by the remote end: " << remoteEndIDString();
876 T* pThis =
static_cast<T*
>(
this);
877 if (m_disconnectEventHandler)
878 m_disconnectEventHandler(pThis);
881 bool isCmdAllowedWithoutHandshake(
ECmdType _cmd)
895 handlerDisconnectEventFunction_t m_disconnectEventHandler;
902 boost::asio::io_service& m_io_service;
903 boost::asio::ip::tcp::socket m_socket;
907 protocolMessagePtrQueue_t m_writeQueue;
908 protocolMessagePtrQueue_t m_writeQueueBeforeHandShake;
910 std::mutex m_mutexWriteBuffer;
911 protocolMessageBuffer_t m_writeBuffer;
912 protocolMessagePtrQueue_t m_writeBufferQueue;
915 typedef std::map<boost::uuids::uuid, binaryAttachmentInfoPtr_t> binaryAttachmentMap_t;
916 binaryAttachmentMap_t m_binaryAttachmentMap;
917 std::mutex m_binaryAttachmentMutex;
919 protocolMessagePtrQueue_t m_accumulativeWriteQueue;
920 deadlineTimerPtr_t m_deadlineTimer;
922 bool m_isShuttingDown;
bool m_isHandshakeOK
Definition: BaseChannelImpl.h:898
std::shared_ptr< T > connectionPtr_t
Definition: BaseChannelImpl.h:192
std::string m_receivedFilePath
Path to the received file.
Definition: BinaryAttachmentReceivedCmd.h:23
boost::uuids::uuid m_fileId
Unique ID of the file.
Definition: BinaryAttachmentCmd.h:29
void accumulativePushMsg(const A &_attachment)
Definition: BaseChannelImpl.h:283
EChannelType
Definition: BaseChannelImpl.h:144
Definition: BaseChannelImpl.h:156
Definition: ProtocolCommands.h:33
EChannelType m_channelType
Definition: BaseChannelImpl.h:899
uint32_t m_fileSize
File size in bytes.
Definition: BinaryAttachmentStartCmd.h:31
Definition: BinaryAttachmentReceivedCmd.h:15
static std::string getDDSPath()
Definition: UserDefaults.cpp:207
Definition: CommandAttachmentImpl.h:55
bool started()
Definition: BaseChannelImpl.h:662
bool isHanshakeOK() const
Definition: BaseChannelImpl.h:230
Definition: BaseChannelImpl.h:148
uint32_t m_fileCrc32
File checksum.
Definition: BinaryAttachmentStartCmd.h:32
void pushBinaryAttachmentCmd(const std::string &_srcFilePath, const std::string &_fileName, uint16_t _cmdSource)
Definition: BaseChannelImpl.h:439
std::shared_ptr< SEmptyCmd > ptr_t
Definition: CommandAttachmentImpl.h:65
Definition: BinaryAttachmentStartCmd.h:21
std::chrono::steady_clock::time_point m_startTime
Definition: BaseChannelImpl.h:174
Definition: ProtocolCommands.h:29
void processBinaryAttachmentStartCmd(SCommandAttachmentImpl< cmdBINARY_ATTACHMENT_START >::ptr_t _attachment)
Definition: BaseChannelImpl.h:507
void registerDisconnectEventHandler(handlerDisconnectEventFunction_t _handler)
Definition: BaseChannelImpl.h:657
MiscCommon::BYTEVector_t m_data
Definition: BaseChannelImpl.h:167
const std::array< std::string, 5 > gChannelTypeName
Definition: BaseChannelImpl.h:152
void accumulativePushMsg()
Definition: BaseChannelImpl.h:357
#define LOG(severity)
Definition: Logger.h:54
std::weak_ptr< T > weakConnectionPtr_t
Definition: BaseChannelImpl.h:193
Definition: SimpleMsgCmd.h:16
Definition: ProtocolCommands.h:34
uint32_t m_size
Size of this piece of binary data.
Definition: BinaryAttachmentCmd.h:31
Definition: BinaryAttachmentCmd.h:21
EChannelType getChannelType() const
Definition: BaseChannelImpl.h:235
void start()
Definition: BaseChannelImpl.h:246
uint32_t m_fileSize
Definition: BaseChannelImpl.h:172
Definition: BaseChannelImpl.h:146
static connectionPtr_t makeNew(boost::asio::io_service &_service)
Definition: BaseChannelImpl.h:223
Definition: dds-agent/src/AgentConnectionManager.h:16
std::string remoteEndIDString()
Definition: BaseChannelImpl.h:667
void pushMsg(const A &_attachment)
Definition: BaseChannelImpl.h:364
Definition: ProtocolMessage.h:77
uint32_t m_crc32
CRC checksum of this piece of binary data.
Definition: BinaryAttachmentCmd.h:32
uint32_t m_offset
Offset for this piece of binary data.
Definition: BinaryAttachmentCmd.h:30
Definition: BaseChannelImpl.h:180
Definition: BaseChannelImpl.h:147
This class implements slots subscription and slots calls associated with certain channel events...
Definition: ChannelEventsImpl.h:27
std::string m_fileName
Name of the file.
Definition: BinaryAttachmentStartCmd.h:30
Definition: BaseChannelImpl.h:42
void dequeueMsg()
Definition: BaseChannelImpl.h:271
SBinaryAttachmentInfo()
Definition: BaseChannelImpl.h:158
void sendYourself()
Definition: BaseChannelImpl.h:433
Definition: BaseChannelImpl.h:40
void pushMsg()
Definition: BaseChannelImpl.h:417
static CProtocolMessage::protocolMessagePtr_t encode(const SEmptyCmd &)
Definition: CommandAttachmentImpl.h:72
uint32_t m_fileCrc32
Definition: BaseChannelImpl.h:170
std::vector< EChannelType > channelTypeVector_t
Definition: BaseChannelImpl.h:151
std::vector< weakConnectionPtr_t > weakConnectionPtrVector_t
Definition: BaseChannelImpl.h:195
void sendYourself(const A &_attachment)
Definition: BaseChannelImpl.h:424
void smart_path(_T *_Path)
The function extends any environment variable found in the give path to its value.
Definition: SysHelper.h:93
Definition: StatImpl.h:112
std::shared_ptr< SBinaryAttachmentInfo > binaryAttachmentInfoPtr_t
Definition: BaseChannelImpl.h:177
MiscCommon::BYTEVector_t m_data
Piece of binary data.
Definition: BinaryAttachmentCmd.h:33
std::vector< unsigned char > BYTEVector_t
An STL vector of bytes.
Definition: def.h:127
std::mutex m_mutex
Definition: BaseChannelImpl.h:173
boost::asio::ip::tcp::socket & socket()
Definition: BaseChannelImpl.h:265
Definition: ChannelEventsImpl.h:20
boost::uuids::uuid m_fileId
Unique ID of the file.
Definition: BinaryAttachmentStartCmd.h:29
uint32_t m_bytesReceived
Definition: BaseChannelImpl.h:168
uint16_t m_srcCommand
Source command which initiated file transport.
Definition: BinaryAttachmentStartCmd.h:33
void pushBinaryAttachmentCmd(const MiscCommon::BYTEVector_t &_data, const std::string &_fileName, uint16_t _cmdSource)
Definition: BaseChannelImpl.h:462
std::string m_fileName
Definition: BaseChannelImpl.h:169
Definition: BaseChannelImpl.h:149
Definition: ProtocolCommands.h:30
std::vector< connectionPtr_t > connectionPtrVector_t
Definition: BaseChannelImpl.h:194
void setChannelType(EChannelType _channelType)
Definition: BaseChannelImpl.h:240
void processBinaryAttachmentCmd(SCommandAttachmentImpl< cmdBINARY_ATTACHMENT >::ptr_t _attachment)
Definition: BaseChannelImpl.h:532
Definition: ChannelMessageHandlersImpl.h:29
uint16_t m_srcCommand
Definition: BaseChannelImpl.h:171
ECmdType
Definition: ProtocolCommands.h:25
Definition: ProtocolCommands.h:28
void stop()
Definition: BaseChannelImpl.h:257
std::shared_ptr< CProtocolMessage > protocolMessagePtr_t
Definition: ProtocolMessage.h:69