简体   繁体   English

FTP服务器实现C ++

[英]FTP Server Implementation C++

I have to implement a kind of FTP server in C++ for a school project. 我必须在C ++中为学校项目实现一种FTP服务器。 The goal is learn how the FTP works internally. 目标是了解FTP如何在内部工作。

I'm a lil bit lost in how to start it. 我对如何开始它有点失落。 I know the FTP Protocol, but I still don't know what can I do to start coding. 我知道FTP协议,但我仍然不知道如何开始编码。

Someone can point me a way to start? 有人能给我指路吗? Some links, libs in C++, etc? 一些链接,C ++中的库等? Remembering that is a server side implementation. 记住这是一个服务器端实现。

Thanks in advance! 提前致谢! :) :)

First off, read the relevant RFCs. 首先,阅读相关的RFC。 Also record a few FTP sessions using something like Wireshark.From there you should get an idea of when messages are sent and what messages are received. 还可以使用Wireshark之​​类的东西记录一些FTP会话。从那里你应该知道何时发送消息以及收到什么消息。 You can the try duplicate the functionality to the point where it can do something useful. 您可以尝试将功能复制到可以执行有用操作的位置。 You will probably need to look at BSD sockets to do the actual network exchange. 您可能需要查看BSD套接字才能进行实际的网络交换。 Good luck. 祝好运。

The API you are looking for is probably Winsock on Windows or Sockets on Unix (Linux). 您正在寻找的API可能是Windows上的Winsock或Unix上的套接字 (Linux)。 That covers all the networking calls you need. 这涵盖了您需要的所有网络呼叫。 If you already know what the protocol looks like, that should get you going. 如果你已经知道协议是什么样的,那应该可以让你前进。

Visit http://msdn.microsoft.com/en-us/library/ms737593%28v=vs.85%29.aspx for complete Server Code. 有关完整的服务器代码,请访问http://msdn.microsoft.com/en-us/library/ms737593%28v=vs.85%29.aspx Go through the code and read about the APIs in MSDN. 浏览代码并阅读MSDN中的API。

Visit http://msdn.microsoft.com/en-us/library/ms737591%28v=vs.85%29.aspx for complete Client Code. 有关完整的客户端代码,请访问http://msdn.microsoft.com/en-us/library/ms737591%28v=vs.85%29.aspx Go through the code and read about the APIs in MSDN. 浏览代码并阅读MSDN中的API。

This is a simple Socket programming which I think can help you. 这是一个简单的Socket编程,我认为可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM