MCPcopy Create free account
hub / github.com/Snapchat/Valdi / submitData

Method submitData

valdi/src/valdi/runtime/Debugger/TCPConnectionImpl.cpp:45–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void TCPConnectionImpl::submitData(const BytesView& bytes) {
46 std::lock_guard<Mutex> guard(_mutex);
47
48 if (_closed) {
49 return;
50 }
51
52 bool wasEmpty = _pendingPackets.empty();
53 _pendingPackets.emplace_back(bytes);
54
55 if (wasEmpty) {
56 _ioService.post([strongSelf = strongSmallRef(this)]() {
57 std::lock_guard<Mutex> lock(strongSelf->_mutex);
58 if (!strongSelf->_closed) {
59 strongSelf->lockFreeDoSend();
60 }
61 });
62 }
63}
64
65void TCPConnectionImpl::lockFreeDoSend() {
66 if (_pendingPackets.empty()) {

Callers 3

submitJsonMethod · 0.45
makeJsConnectionFunction · 0.45
submitPayloadMethod · 0.45

Calls 4

strongSmallRefFunction · 0.85
lockFreeDoSendMethod · 0.80
postMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected