MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / StartSending

Method StartSending

Src/Common/FSecure/Sockets/DuplexConnection.cpp:30–56  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

28
29////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
30void FSecure::DuplexConnection::StartSending()
31{
32 m_IsSending = true;
33 m_SendingThread = std::thread([this]
34 {
35 try
36 {
37 while (true)
38 {
39 ByteVector message;
40 {
41 std::unique_lock lock(m_MessagesMutex);
42 if (!m_IsSending)
43 break;
44 message = GetMessage(lock);
45 if (message.empty())
46 break; // connection closed
47 }
48 m_ClientSocket.Send(message);
49 }
50 }
51 catch (FSecure::SocketsException&)
52 {
53 Stop();
54 }
55 });
56}
57
58////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
59FSecure::ByteVector FSecure::DuplexConnection::Receive()

Callers 1

RunApiBrigeMethod · 0.80

Calls 2

emptyMethod · 0.45
SendMethod · 0.45

Tested by

no test coverage detected