On Wed, Apr 27, 2005 at 10:12:39AM +1200, Sidney Markowitz wrote: > A fix would be to close and reopen the socket at each message, or as you > suggested when the counter wraps. But it should not be when the counter > wraps to zero, it should be when it wraps to its initial value.
Yeah. But then we have to store the initial value, etc, etc. By wrapping at 0, we get basically the same functionality, but it occurs more frequently than it has to. It's "randomly" in between new socket per message and 1 socket per child. > I think it would be better to create the new socket with each message. If > old replies are arriving as they seem to, wouldn't it be more efficient to > not have a listener on the socket when they arrive? True, but 1) that's more overhead, 2) in theory the child (or a different child) could get the same socket back after processing a single message (depends how the OS assigns out new sockets). I like the idea of only getting a new socket when necessary (or thereabouts), which leaves the issue still possible but very unlikely. -- Randomly Generated Tagline: My favorite mythical creature? The honest politician.
pgpSxamaa8jGv.pgp
Description: PGP signature
