Loops.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 #ifndef SQUID_SRC_COMM_LOOPS_H
10 #define SQUID_SRC_COMM_LOOPS_H
11 
12 #include "comm/Flag.h"
13 #include "comm/forward.h"
14 #include "defines.h"
15 
16 /* Comm layer select loops API.
17  *
18  * These API functions must be implemented by all FD IO loops used by Squid.
19  * Defines are provided short-term for legacy code. These will disappear soon.
20  */
21 
22 namespace Comm
23 {
24 
26 void SelectLoopInit(void);
27 
29 inline void
30 ResetSelect(int fd)
31 {
32  SetSelect(fd, COMM_SELECT_READ|COMM_SELECT_WRITE, nullptr, nullptr, 0);
33 }
34 
38 Comm::Flag DoSelect(int);
39 
40 void QuickPollRequired(void);
41 
47 #if _SQUID_WINDOWS_
48 #define INCOMING_UDP_MAX 1
49 #else
50 #define INCOMING_UDP_MAX 15
51 #endif
52 
56 #if _SQUID_WINDOWS_
57 #define INCOMING_DNS_MAX 1
58 #else
59 #define INCOMING_DNS_MAX 15
60 #endif
61 
66 #if _SQUID_WINDOWS_
67 #define INCOMING_TCP_MAX 1
68 #else
69 #define INCOMING_TCP_MAX 10
70 #endif
71 #define INCOMING_TOTAL_MAX (INCOMING_TCP_MAX+INCOMING_UDP_MAX+INCOMING_DNS_MAX)
72 
73 } // namespace Comm
74 
75 #endif /* SQUID_SRC_COMM_LOOPS_H */
76 
Comm::Flag DoSelect(int)
Do poll and trigger callback functions as appropriate.
Definition: ModDevPoll.cc:308
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:16
#define COMM_SELECT_READ
Definition: defines.h:24
void SelectLoopInit(void)
Initialize the module on Squid startup.
Definition: ModDevPoll.cc:170
Flag
Definition: Flag.h:15
void ResetSelect(int fd)
reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
Definition: Loops.h:30
void SetSelect(int, unsigned int, PF *, void *, time_t)
Mark an FD to be watched for its IO status.
Definition: ModDevPoll.cc:220
#define COMM_SELECT_WRITE
Definition: defines.h:25
void QuickPollRequired(void)
Definition: ModDevPoll.cc:414

 

Introduction

Documentation

Support

Miscellaneous