MCPcopy Create free account
hub / github.com/boostorg/beast / testAsyncWriteFrame

Method testAsyncWriteFrame

test/beast/websocket/write.cpp:582–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580 }
581
582 void
583 testAsyncWriteFrame()
584 {
585 for(int i = 0; i < 2; ++i)
586 {
587 for(;;)
588 {
589 echo_server es{log, i==1 ?
590 kind::async : kind::sync};
591 net::io_context ioc;
592 stream<test::stream> ws{ioc};
593 ws.next_layer().connect(es.stream());
594
595 error_code ec;
596 ws.handshake("localhost", "/", ec);
597 if(! BEAST_EXPECTS(! ec, ec.message()))
598 break;
599 ws.async_write_some(false,
600 net::const_buffer{},
601 [&](error_code, std::size_t)
602 {
603 fail();
604 });
605 if(! BEAST_EXPECTS(! ec, ec.message()))
606 break;
607 //
608 // Destruction of the io_context will cause destruction
609 // of the write_some_op without invoking the final handler.
610 //
611 break;
612 }
613 }
614 }
615
616 void
617 testMoveOnly()

Callers

nothing calls this directly

Calls 4

messageMethod · 0.80
async_write_someMethod · 0.80
failFunction · 0.50
handshakeMethod · 0.45

Tested by

no test coverage detected