MCPcopy Create free account
hub / github.com/bcndev/bytecoin / start_write

Method start_write

src/platform/Network.cpp:766–784  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764 }
765
766 void start_write() {
767 if (pending_write || !connected || !owner)
768 return;
769 if (outgoing_buffer.empty()) {
770 if (asked_shutdown)
771 start_shutdown();
772 return;
773 }
774 pending_write = true;
775 boost::array<boost::asio::const_buffer, 2> bufs{
776 {boost::asio::buffer(outgoing_buffer.read_ptr(), outgoing_buffer.read_count()),
777 boost::asio::buffer(outgoing_buffer.read_ptr2(), outgoing_buffer.read_count2())}};
778#if platform_USE_SSL
779 if (ssl_socket)
780 ssl_socket->async_write_some(bufs, std::bind(&Impl::handle_write, owner->impl, _1, _2));
781 else
782#endif
783 socket.async_write_some(bufs, std::bind(&Impl::handle_write, owner->impl, _1, _2));
784 }
785
786 void handle_write(const boost::system::error_code &e, std::size_t bytes_transferred) {
787 pending_write = false;

Callers 1

write_someMethod · 0.80

Calls 5

read_ptrMethod · 0.80
read_countMethod · 0.80
read_ptr2Method · 0.80
read_count2Method · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected