MCPcopy Create free account
hub / github.com/dermesser/libsocket / run_string_client

Function run_string_client

examples++/dgram_over_stream.cpp:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void run_string_client(void) {
89 libsocket::inet_stream client(HOST, PORT, LIBSOCKET_IPv4);
90 libsocket::dgram_over_stream dgram_cl(std::move(client));
91
92 std::string recvbuf(0, 'a');
93 recvbuf.resize(3);
94
95 dgram_cl.sndmsg(std::string("Hello"));
96 std::cout << "Client received " << dgram_cl.rcvmsg(&recvbuf)
97 << " bytes into std::string.\n";
98 std::cout << recvbuf << std::endl;
99
100 return;
101}
102
103void run_vec_client(void) {
104 libsocket::inet_stream client(HOST, PORT, LIBSOCKET_IPv4);

Callers 1

mainFunction · 0.85

Calls 2

sndmsgMethod · 0.80
rcvmsgMethod · 0.80

Tested by

no test coverage detected