94 fd(aFd), errNo(anErrNo), mapId(aMapId)
122 " mapId=" << request.
mapId);
125 request.
pack(message);
149 const DelayedSharedListenRequests::size_type concurrencyLimit = 1;
162 debugs(54, 3,
"got listening FD " << response.
fd <<
" errNo=" <<
163 response.
errNo <<
" mapId=" << response.
mapId <<
" with " <<
170 auto por = pori->second;
174 auto &answer = por.callback.answer();
176 auto &conn = answer.conn;
177 conn->fd = response.
fd;
181 conn->local = p.
addr;
182 conn->flags = p.
flags;
184 struct addrinfo *AI =
nullptr;
187 AI->ai_protocol = p.
proto;
192 answer.errNo = response.
errNo;
#define Assure(condition)
#define ScheduleCallHere(call)
std::map< Ipc::RequestId::Index, PendingOpenRequest > SharedListenRequestMap
maps ID assigned at request time to the response callback
static DelayedSharedListenRequests TheDelayedRequests
static void SendSharedListenRequest(const PendingOpenRequest &por)
static SharedListenRequestMap TheSharedListenRequestMap
static void kickDelayedRequest()
static Ipc::RequestId::Index AddToMap(const PendingOpenRequest &por)
std::list< PendingOpenRequest > DelayedSharedListenRequests
accumulates delayed requests until they are ready to be sent, in FIFO order
int compareWhole(const Ip::Address &rhs) const
static void FreeAddr(struct addrinfo *&ai)
void getAddrInfo(struct addrinfo *&ai, int force=AF_UNSPEC) const
"shared listen" is when concurrent processes are listening on the same fd
int fdNote
index into fd_note() comment strings
bool operator<(const OpenListenerParams &p) const
useful for map<>
Ip::Address addr
will be memset and memcopied
static String CoordinatorAddr()
get the IPC message address for coordinator process
a request for a listen socket with given parameters
OpenListenerParams params
actual comm_open_sharedListen() parameters
SharedListenRequest(const OpenListenerParams &, RequestId aMapId)
sender's constructor
RequestId mapId
to map future response to the requestor's callback
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
a response to SharedListenRequest
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
SharedListenResponse(int fd, int errNo, RequestId aMapId)
sender's constructor
int fd
opened listening socket or -1
RequestId mapId
to map future response to the requestor's callback
int errNo
errno value from comm_open_sharedListen() call
struct msghdr with a known type, fixed-size I/O and control buffers
int getFd() const
returns stored descriptor
void putFd(int aFd)
stores descriptor
void getPod(Pod &pod) const
load POD
void checkType(int aType) const
void putPod(const Pod &pod)
store POD
void setType(int aType)
sets message type; use MessageType enum
holds information necessary to handle JoinListen response
Ipc::StartListeningCallback callback
Ipc::OpenListenerParams params
actual comm_open_sharedListen() parameters
void comm_import_opened(const Comm::ConnectionPointer &conn, const char *note, struct addrinfo *AI)
update Comm state after getting a comm_open() FD from another process
#define debugs(SECTION, LEVEL, CONTENT)
bool IsConnOpen(const Comm::ConnectionPointer &conn)
void SendMessage(const String &toAddress, const TypedMsgHdr &message)
void SharedListenJoined(const SharedListenResponse &response)
process Coordinator response to SharedListenRequest
const char * FdNote(int fdNodeId)
converts FdNoteId into a string
void JoinSharedListen(const OpenListenerParams &, StartListeningCallback &)
prepare and send SharedListenRequest to Coordinator