MCPcopy Create free account
hub / github.com/LUX-Core/lux / write

Method write

src/cpp-ethereum/libp2p/Session.cpp:258–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void Session::write()
259{
260 bytes const* out = nullptr;
261 DEV_GUARDED(x_framing)
262 {
263 m_io->writeSingleFramePacket(&m_writeQueue[0], m_writeQueue[0]);
264 out = &m_writeQueue[0];
265 }
266 auto self(shared_from_this());
267 ba::async_write(m_socket->ref(), ba::buffer(*out), [this, self](boost::system::error_code ec, std::size_t /*length*/)
268 {
269 ThreadContext tc(info().id.abridged());
270 ThreadContext tc2(info().clientVersion);
271 // must check queue, as write callback can occur following dropped()
272 if (ec)
273 {
274 clog(NetWarn) << "Error sending: " << ec.message();
275 drop(TCPError);
276 return;
277 }
278
279 DEV_GUARDED(x_framing)
280 {
281 m_writeQueue.pop_front();
282 if (m_writeQueue.empty())
283 return;
284 }
285 write();
286 });
287}
288
289void Session::writeFrames()
290{

Callers 9

putOutFunction · 0.45
mainFunction · 0.45
BlockChainLoaderMethod · 0.45
main.cppFile · 0.45
test_setChainParamsMethod · 0.45
writeFileMethod · 0.45
dumpFunction · 0.45
Put2Method · 0.45
CRYPTOPP_API mainFunction · 0.45

Calls 3

abridgedMethod · 0.80
refMethod · 0.45
messageMethod · 0.45

Tested by 4

BlockChainLoaderMethod · 0.36
test_setChainParamsMethod · 0.36
dumpFunction · 0.36
CRYPTOPP_API mainFunction · 0.36