in reply to Passing a socket to a parent

I think it might be possible, but have you considered using select() or IO::Poll instead? It might be less work than trying to pass sockets around between processes and it should scale better. Forking a few children is fine, but forking a couple hundred will cause problems.

I bet those shiny new books on network programming in Perl have something you could use...

-sam

Replies are listed 'Best First'.
Re: Re: Passing a socket to a parent
by suaveant (Parson) on Jun 04, 2002 at 02:56 UTC
    I am using select, but since I am doing thousands of connects (flaw in gnutella spec, lists files sharing and kb shared on pong, but not how many open connection slots they have available...). This tends to chew into my good old packet handling time, which there is quite a lot of, due to the nature of gnutella.

                    - Ant
                    - Some of my best work - (1 2 3)

      Does that mean you intend to solve the problem by forking thousands of children? If so, I don't think that will result in much of an improvement! Have you tried IO::Poll? Rumor has it that it's capable of better performance than good ol' select().

      -sam

        No, not at all... my thought was to divorce the connection process to one child, so I don't slow down my packet handling with timing out socket connects and the like...

        I haven't tried IO::Poll, I will take a look at it... though my problem isn't really with IO::Select, more so with the overhead of making socket connections...

                        - Ant
                        - Some of my best work - (1 2 3)