At 11:04 AM 2/2/01 -0800, Rob Bloodgood wrote:
>So, in my mod_perl app, I run thru each request, then blast a UDP packet to
>a process on the local machine that collects statistics on my traffic:
>
><snip>



>My question is, should I be creating this socket for every request?  OR
>would it be more "correct" to create it once on process startup and stash it
>in $r->pnotes or something?

we have similar code in a mod_perl environment  for sending Multicast UDP 
packets - I just store the socket filehandle  in a global when it's 
created,  and the next request can pick it up from there (just test if the 
global is defined).
keeping the endpoint info in pnotes is only useful if you need write 
multiple UDP packets per request.

-Simon



>And if I did that, would it work w/ TCP?  Or unix pipes/sockets (which I
>*don't* understand) (btw the box is linux)?  In testing, I'd prefer not to
>use TCP because it blocks if the count server is hung or down, vs UDP, where
>I just lose a couple of packets.
>
>TIA!
>
>L8r,
>Rob

-----------------------------------------------------
Simon Rosenthal ([EMAIL PROTECTED])          
Web Systems Architect
Northern Light Technology
One Athenaeum Street. Suite 1700, Cambridge, MA  02142
Phone:  (617)621-5296  :       URL:  http://www.northernlight.com
"Northern Light - Just what you've been searching for"

Reply via email to