| 86 | } |
| 87 | |
| 88 | void 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 | |
| 103 | void run_vec_client(void) { |
| 104 | libsocket::inet_stream client(HOST, PORT, LIBSOCKET_IPv4); |