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

Function main

examples++/unix_dgram_server.cpp:8–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6// Sends a little log message via DGRAM to the syslogd
7
8int main(void) {
9 std::string req;
10 std::string client;
11
12 req.resize(64);
13 client.resize(64);
14
15 try {
16 libsocket::unix_dgram_server srv("/tmp/srvsock");
17
18 srv.rcvfrom(req, client);
19
20 std::cout << "[server process] " << req << " from " << client
21 << std::endl;
22
23 srv.sndto("Hiho, client!", client);
24
25 srv.destroy();
26
27 } catch (const libsocket::socket_exception& exc) {
28 std::cerr << exc.mesg;
29 }
30
31 return 0;
32}

Callers

nothing calls this directly

Calls 3

destroyMethod · 0.80
rcvfromMethod · 0.45
sndtoMethod · 0.45

Tested by

no test coverage detected