StrandSearch.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 /* DEBUG: section 54 Interprocess Communication */
10 
11 #include "squid.h"
12 #include "globals.h"
13 #include "ipc/Messages.h"
14 #include "ipc/StrandSearch.h"
15 #include "ipc/TypedMsgHdr.h"
16 
18  requestorId(KidIdentifier),
19  tag(aTag),
20  qid(MyQuestionerId())
21 {
22 }
23 
25  requestorId(-1)
26 {
27  hdrMsg.checkType(mtFindStrand);
28  hdrMsg.getPod(requestorId);
29  hdrMsg.getString(tag);
30  qid.unpack(hdrMsg);
31 }
32 
34 {
35  hdrMsg.setType(mtFindStrand);
36  hdrMsg.putPod(requestorId);
37  hdrMsg.putString(tag);
38  qid.pack(hdrMsg);
39 }
40 
void setType(int aType)
sets message type; use MessageType enum
Definition: TypedMsgHdr.cc:100
void checkType(int aType) const
Definition: TypedMsgHdr.cc:94
int KidIdentifier
int requestorId
sender-provided return address
Definition: StrandSearch.h:29
StrandSearchRequest(const String &aTag)
sender's constructor
Definition: StrandSearch.cc:17
void putPod(const Pod &pod)
store POD
Definition: TypedMsgHdr.h:127
String tag
set when looking for a matching StrandCoord::tag
Definition: StrandSearch.h:30
void unpack(const TypedMsgHdr &)
for receiving the ID of the asking process
Definition: QuestionerId.cc:31
@ mtFindStrand
a worker requests a strand from Coordinator
Definition: Messages.h:25
void getString(String &s) const
load variable-length string
Definition: TypedMsgHdr.cc:125
QuestionerId qid
the sender of the request
Definition: StrandSearch.h:31
QuestionerId MyQuestionerId()
the questioner ID of the current/calling process
Definition: QuestionerId.cc:18
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:33
void getPod(Pod &pod) const
load POD
Definition: TypedMsgHdr.h:116
void putString(const String &s)
store variable-length string
Definition: TypedMsgHdr.cc:143
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
Definition: StrandSearch.cc:33

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors