I'm trying to implement a FTP client in PHP and I'm having problems with the active mode.
I'm not very very familiar with some points of socket programming.
The situation is this:
- I connect to the server and I authenticate
- I change to active mode by sending "PORT n1,n2,n3,n4,n5,n6"
- I create a server socket for incoming connection
- I send the command "RETR " so the server can connect to n5 * 256 + n6
What I don't know is how to create the server socket (3) and leave it working and expecting connection so I can send the RETR command (4).
If you can give me at least a point of view, it would be great.
Thanks in advance.
C++
andc
? – Paweł Stawarz