MCPcopy Create free account
hub / github.com/3rdparty/libprocess / accept

Method accept

src/posix/libevent/libevent_ssl_socket.cpp:1006–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004
1005
1006Future<std::shared_ptr<SocketImpl>> LibeventSSLSocketImpl::accept()
1007{
1008 // Note that due to MESOS-8448, when the caller discards, it's
1009 // possible that we pull an accepted socket out of the queue but
1010 // drop it when `.then` transitions to discarded rather than
1011 // executing the continuation. This is currently acceptable since
1012 // callers only discard when they're breaking their accept loop.
1013 // However, from an API perspective, we shouldn't be dropping
1014 // the socket on the floor.
1015 //
1016 // We explicitly specify the return type to avoid a type deduction
1017 // issue in some versions of clang. See MESOS-2943.
1018 return accept_queue.get()
1019 .then([](const Future<std::shared_ptr<SocketImpl>>& impl)
1020 -> Future<std::shared_ptr<SocketImpl>> {
1021 CHECK(!impl.isPending());
1022 return impl;
1023 });
1024}
1025
1026
1027void LibeventSSLSocketImpl::peek_callback(

Callers

nothing calls this directly

Calls 3

isPendingMethod · 0.80
thenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected