Recently I was designing a simple ftp. When a client connects to server, server create a special Socket for this connection:
Socket clientSocket = listenSocket.accept();
I want to use this socket to send commands to server and create a new one to send data. So I have two questions.
Appreciate Your advice!
You might look at the FTP spec here: http://tools.ietf.org/html/rfc959 Specifically, check out page 3. You'll see FTP has a passive data port which waits for connections in addition to the control connection. Also, there is a diagram on page 7 which clarifies the typical FTP approach. Replicating it would certainly be a viable strategy.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.