MCPcopy Create free account
hub / github.com/boostorg/asio / test

Function test

test/local/seq_packet_protocol.cpp:50–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void test()
51{
52 using namespace boost::asio;
53 namespace local = boost::asio::local;
54 typedef local::seq_packet_protocol spp;
55
56 try
57 {
58 io_context ioc;
59 char mutable_char_buffer[128] = "";
60 const char const_char_buffer[128] = "";
61 const socket_base::message_flags in_flags = 0;
62 socket_base::message_flags out_flags = 0;
63 socket_base::send_buffer_size socket_option;
64 socket_base::bytes_readable io_control_command;
65 archetypes::immediate_handler immediate;
66 boost::system::error_code ec;
67
68 // basic_seq_packet_socket constructors.
69
70 spp::socket socket1(ioc);
71 spp::socket socket2(ioc, spp());
72 spp::socket socket3(ioc, spp::endpoint());
73#if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
74 spp::socket::native_handle_type native_socket1
75 = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
76 spp::socket socket4(ioc, spp(), native_socket1);
77#endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
78
79 spp::socket socket5(std::move(socket4));
80
81 // basic_seq_packet_socket operators.
82
83 socket1 = spp::socket(ioc);
84 socket1 = std::move(socket2);
85
86 // I/O object functions.
87
88 spp::socket::executor_type ex = socket1.get_executor();
89 (void)ex;
90
91 // basic_socket functions.
92
93 spp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
94 (void)lowest_layer;
95
96 socket1.open(spp());
97 socket1.open(spp(), ec);
98
99#if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
100 spp::socket::native_handle_type native_socket2
101 = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
102 socket1.assign(spp(), native_socket2);
103 spp::socket::native_handle_type native_socket3
104 = ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
105 socket1.assign(spp(), native_socket3, ec);
106#endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
107

Callers

nothing calls this directly

Calls 15

bufferFunction · 0.85
endpointClass · 0.50
get_executorMethod · 0.45
openMethod · 0.45
assignMethod · 0.45
is_openMethod · 0.45
closeMethod · 0.45
native_handleMethod · 0.45
cancelMethod · 0.45
at_markMethod · 0.45
availableMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected