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

Method bind

lib_acl_cpp/src/stream/aio_socket_stream.cpp:235–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235aio_socket_stream* aio_socket_stream::bind(aio_handle* handle, const char * addr)
236{
237 acl_assert(handle);
238 unsigned flag = ACL_INET_FLAG_NBLOCK | ACL_INET_FLAG_REUSEPORT;
239
240 ACL_VSTREAM* vstream = acl_vstream_bind(addr, 0, flag);
241 if (vstream == NULL) {
242 logger_error("bind %s error %s", addr, last_serror());
243 return NULL;
244 }
245
246 ACL_AIO* aio = handle->get_handle();
247 ACL_ASTREAM* astream = acl_aio_open(aio, vstream);
248 aio_socket_stream* stream = NEW aio_socket_stream(handle, astream, true);
249 return stream;
250}
251
252bool aio_socket_stream::is_opened() const
253{

Callers

nothing calls this directly

Calls 5

acl_vstream_bindFunction · 0.85
acl_aio_openFunction · 0.85
last_serrorFunction · 0.50
aio_socket_streamClass · 0.50
get_handleMethod · 0.45

Tested by

no test coverage detected