[英]creating simple ftp using Java
Recently I was designing a simple ftp. 最近,我正在设计一个简单的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. 您可以在此处查看FTP规范: http : //tools.ietf.org/html/rfc959具体来说,请查看第3页。您将看到FTP具有被动数据端口,除了控制连接外,它还等待连接。 Also, there is a diagram on page 7 which clarifies the typical FTP approach.
另外,第7页上的图阐明了典型的FTP方法。 Replicating it would certainly be a viable strategy.
复制它肯定是一个可行的策略。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.