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

Function to_oflags

lib_acl_cpp/src/stream/socket_stream.cpp:64–91  ·  view source on GitHub ↗

�� C++ API �� flags ת��Ϊ C API �� flags.

Source from the content-addressed store, hash-verified

62
63// �� C++ API �� flags ת��Ϊ C API �� flags.
64static unsigned to_oflags(unsigned flags) {
65 unsigned oflags = 0;
66
67 if (flags & OPEN_FLAG_NONBLOCK) {
68 oflags |= ACL_NON_BLOCKING;
69 } else {
70 oflags |= ACL_BLOCKING;
71 }
72
73 if (flags & OPEN_FLAG_REUSEPORT) {
74 oflags |= ACL_INET_FLAG_REUSEPORT;
75 }
76
77 // It's only useful for TCP.
78 if (flags & OPEN_FLAG_FASTOPEN) {
79 oflags |= ACL_INET_FLAG_FASTOPEN;
80 }
81
82 if (flags & OPEN_FLAG_EXCLUSIVE) {
83 oflags |= ACL_INET_FLAG_EXCLUSIVE;
84 }
85
86 if (flags & OPEN_FLAG_MULTICAST_LOOP) {
87 oflags |= ACL_INET_FLAG_MULTILOOP_ON;
88 }
89
90 return oflags;
91}
92
93bool socket_stream::bind_udp(const char* addr, int rw_timeout /* = -1 */,
94 unsigned flags /* = 0 */) {

Callers 2

bind_udpMethod · 0.85
bind_multicastMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…