Outbound port on sockets

Grant Edwards grante at visi.com
Fri Sep 15 10:41:26 EDT 2006


On 2006-09-15, Diez B. Roggisch <deets at nospam.web.de> wrote:

>>>> Is it possible to specify which port to use as the outbound port on a
>>>> connection? 
>> [...]
>>>> Specifically, I'm trying to write an FTP host, and I'm trying to
>>>> implement the PORT command. 
>>>
>>> AFAIK you neither can't do that nor need it.
>> 
>> It's not the issue here, but to specify the outgoing port
>> call bind(('', portnum)) before connect().
>
> I wasn't aware of that. Cool.

It's an interesting thing to know, but I've been doing TCP
stuff for many years and never run across a situation where
it's something I needed to do.  If somebody in this thread
actually does need to do it, I'd be curious bout why...

-- 
Grant Edwards                   grante             Yow!  .. this must be what
                                  at               it's like to be a COLLEGE
                               visi.com            GRADUATE!!



More information about the Python-list mailing list