MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / udp_count_processes

Function udp_count_processes

net/net_udp.c:67–89  ·  view source on GitHub ↗

tells how many processes the UDP layer will create */

Source from the content-addressed store, hash-verified

65
66/* tells how many processes the UDP layer will create */
67int udp_count_processes(unsigned int *extra)
68{
69 struct socket_info_full *sif;
70 unsigned int n, e, i;
71
72 if (udp_disabled) {
73 if (extra) *extra = 0;
74 return 0;
75 }
76
77 for( i=0,n=0,e=0 ; i<PROTO_LAST ; i++)
78 if (protos[i].id!=PROTO_NONE && is_udp_based_proto(i))
79 for( sif=protos[i].listeners ; sif; sif=sif->next) {
80 const struct socket_info *si = &sif->socket_info;
81 n+=si->workers;
82 if (si->s_profile)
83 if (si->s_profile->max_procs > si->workers)
84 e+=si->s_profile->max_procs-si->workers;
85 }
86
87 if (extra) *extra = e;
88 return n;
89}
90
91#ifdef USE_MCAST
92/**

Callers 3

mainFunction · 0.85
count_child_processesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected