perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Rosenthal <>
Subject Re: Socket/PIPE/Stream to long running process
Date Wed, 07 Feb 2001 21:47:29 GMT
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:

>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.


>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.

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

View raw message