Getting a free TCP port & blocking it

Tim Roberts timr at probo.com
Sat Mar 1 02:11:39 EST 2008


theneb <onetwofour at gmail.com> wrote:
>Hi all,
>I'm attempting to block a TCP port from any other application from
>using it until I free it from python, this is so that:
>1). Generate a random free user-space port
>2). Generate the script for the external program with the port
>3). Free the port before external program execution.

What's the point?  Why can't the actual user of the port create the port,
and then notify the other side of the port number?

And why don't you just specify a port number of 0 and let the system assign
you a free port number?
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list