MCPcopy Create free account
hub / github.com/acl-dev/acl / open

Method open

lib_acl_cpp/samples/multicast/main.cpp:12–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 }
11
12 bool open(const char* addr, const char* iface, int port) {
13 unsigned oflags = acl::OPEN_FLAG_REUSEPORT;
14 if (loopback_) {
15 oflags |= acl::OPEN_FLAG_MULTICAST_LOOP;
16 }
17
18 if (ss_.bind_multicast(addr, iface, port, -1, oflags)) {
19 printf("Open ok, addr=%s, iface=%s, port=%d\r\n",
20 addr, iface, port);
21 return true;
22 }
23
24 printf("Bind error=%s, addr=%s, iface=%s, port=%d\r\n",
25 acl::last_serror(), addr, iface, port);
26 return false;
27 }
28
29protected:
30 acl::socket_stream ss_;

Callers 8

mainFunction · 0.45
mainFunction · 0.45
rpc_runMethod · 0.45
initMethod · 0.45
mainFunction · 0.45
accept_callbackMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

bind_multicastMethod · 0.80
last_serrorFunction · 0.50

Tested by

no test coverage detected