The stupid question is the question not asked | |
PerlMonks |
Re: Mysterious bad file descriptor after forkby sgt (Deacon) |
on Jul 11, 2007 at 08:24 UTC ( [id://625968]=note: print w/replies, xml ) | Need Help?? |
Well you did not tell us the OS. First I would look at the conditions to get EBADF error conditions with select. Probably you got some error condition that invalidate read or write on the "latest selected desc". Then you seem to be using a mixed scheme with an accept-fork loop and a select loop. usually I tend to use one or the other i.e So I don't understand your grand scheme of things...can you explain a bit more. In any case the "sharing" of data between father and child you seem to imply seems suspicious to me: it can only be a "one-go" thing anyway, why not do the necessary init in the child anyway? One basic rule is also that given a desc opened (with the close-on-exec flag not set) in the father, only the child or the father must use it at any time, meaning better to close it in the father if meant for the child. Are you sure your code comply with that? Can you post a representative snippet we could try? If you use a file instead of a db, does it work? You could also have a look to Net::Server. cheers --stephan
In Section
Seekers of Perl Wisdom
|
|