in reply to Re: TCP Server using fork to accept multiple requests
in thread TCP Server using fork to accept multiple requests

# parent, nothing to do
Um, except close the socket which is fairly important.

Nevermind, This is perl, not C, I'm a moron.

Replies are listed 'Best First'.
Re^3: TCP Server using fork to accept multiple requests
by tybalt89 (Monsignor) on Aug 20, 2022 at 16:29 UTC

    The socket is closed when $new_sock goes out of its scope, which is the "if" statement, so the socket IS closed when the outer "while" repeats. All the parent has to do is exit the "if".

      Post updated. Sorry for the noise.