Re: FTP data connection
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/29/04
- Next message: Achraf: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Previous message: David Schwartz: "Re: Can TCP_NODELAY be turned on and off in a single session?"
- In reply to: Christian: "Re: FTP data connection"
- Next in thread: David Schwartz: "Re: FTP data connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 11:48:30 -0400
In article <c6q8c2$3dg$1@reader1.imaginet.fr>,
"Christian" <cgregoir99@yahoo.com> wrote:
> "those who know me have no need of my name" <not-a-real-address@usa.net>
> wrote in message news:m1ekq7hq86.gnus@usa.net...
> > in comp.unix.programmer i read:
> >
> > >When ftp'ing to a host, in active mode, the FTP server then connects back
> to
> > >the client using the TCP port 20 to send the data, no matter how many
> > >connections are opened. Each one sees data coming from port 20.
> > >
> > >How is it performed programmatically ? I'm writing a FTP server, and i
> can't
> > >figure out how to connect to the client, given the port it sent me, using
> > >always the same port.
> >
> > call bind before connect.
>
> You mean that the FTP server will have to bind() to TCP port 20 for every
> connection it makes back to the client ? I reckon that from the second call
> on, it will fail, won't it ?
It should use SO_REUSEADDR. Since the remote port will be different for
each connection, there's no reason for it to fail.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Achraf: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Previous message: David Schwartz: "Re: Can TCP_NODELAY be turned on and off in a single session?"
- In reply to: Christian: "Re: FTP data connection"
- Next in thread: David Schwartz: "Re: FTP data connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|