|
|
| Perl-Sensitive Sunglasses | |
| PerlMonks |
Unix-Domain TCP Server Crashingby wokka (Acolyte) |
| on Aug 16, 2010 at 19:14 UTC ( #855342=perlquestion: print w/ replies, xml ) | Need Help?? |
|
wokka has asked for the
wisdom of the Perl Monks concerning the following question:
I was trying out the Unix-Domain sockets example in the perlipc documentation, and I'm running into some behavior I don't quite understand.
When I run the server and fire off one client request at a time, it behaves just fine, but if I do something like: ~/tmp$ ./sockclient & ./sockclient & ./sockclientIn an attempt to fire off multiple requests at once from a bash prompt (where '~/tmp$' is the prompt), the server will die with no errors. Once or twice it segfaulted, but most of the time one or two repetitions of the above line will cause the server to simply die. This behavior is consistent and reproducible on my Ubuntu desktop, a Slackware VM, and a FreeBSD server (all running bash). Given the following server code (taken directly from the documentation):
The client terminal looks like this: ~/tmp$ ./sockclient & ./sockclient &./sockclient 1 27089 2 27090 Hello there, it's now Mon Aug 16 15:09:34 2010 Hello there, it's now Mon Aug 16 15:09:34 2010 Hello there, it's now Mon Aug 16 15:09:34 2010 You will be married within a year, and divorced within two. ~/tmp$ You will remember something that you should not have forgotten. Just to have it is enough.And the server terminal looks like this: ~/tmp$ ./sockserv ./sockserv 22710: server started on catsock at Mon Aug 16 15:02:33 2010 ./sockserv 22710: connection on catsock at Mon Aug 16 15:09:34 2010 ./sockserv 22710: begat 27092 at Mon Aug 16 15:09:34 2010 ./sockserv 22710: connection on catsock at Mon Aug 16 15:09:34 2010 ./sockserv 22710: begat 27093 at Mon Aug 16 15:09:34 2010 ./sockserv 22710: connection on catsock at Mon Aug 16 15:09:34 2010 ./sockserv 22710: begat 27094 at Mon Aug 16 15:09:34 2010 ./sockserv 22710: reaped 27092 at Mon Aug 16 15:09:34 2010 ./sockserv 22710: reaped 27094 at Mon Aug 16 15:09:34 2010 ~/tmp$Any ideas what's going on here? The only hint I have is that the third reaping isn't happening. Since it's consistent across the environments I have, it's got to be something with the code or the way I'm calling the client, but I don't know the specifics and would appreciate any edification you can offer.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||