A socket is not a resource which you can store in shared memory. There is deep UNIX mojo which will allow you to pass open file descriptors between processes, but it's somewhat involved. If you're really stuck on passing filehandles around, get a copy of Stevens' Unix Network Programming and/or Advanced Programming in the Unix Environment (I know the later talks about passing filehandles, and I think the former specifically covers tossing around sockets); you should be able to translate everything to the equivalent operations in perl.
Consider instead doing something similar to what apache does (the fork'd children each call accept on a socket opened before they were created and shared between all of the children (with apropriate locking to make sure only one calls accept at a time)). Or fork off the child after the connection comes in, in which case it'll just inherit the socket. Or take a look at POE.
In reply to Re: Storing Socket Connections in Shared Memory
by Fletch
in thread Storing Socket Connections in Shared Memory
by tcf22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |