1 Star 0 Fork 0

fanzc/X_FTP_SERVER

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

X_FTP_server


简介

一个基于libevent的高并发FTP服务器,作者 谢森鑫

目录介绍:

code:源代码,其中主要代码目录为 code/X_FTP_server/src

doc: 项目文档目录

libs:依赖库,主要为openssl和libevent

在线体验:

47.119.134.217:21, 匿名登录即可

文档

Part I Part II Part III Part IV Part V Part VI Part VII
项目背景 并发模型 主要流程 整体架构 遇到的问题 并发测试 相关知识

开发工具

  • 操作系统: CentOS Linux 7.7.1908 (Core) 和 Window10
  • 开发工具: Vim 、VS2017
  • 编译器: g++ 4.8.0
  • 版本控制: git
  • 工程构建: make、VS2017
  • 调试工具: gdb
  • 压测工具: Jmeter

使用方式(服务器端)

Linux:

git clone https://gitee.com/hsby/ftp_Server
tar -zxvf libs/lib_and_include.tar.gz -C /usr/local/
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig
./FTP_server

注意不能少去第2和第3步,否则缺少libevent.so

Windows:

直接打开FTP_server.exe

技术要点

  • 并发模型为Reactor
  • 使用libevent默认的epollLT触发+EPOLLONESHOT
  • 为充分利用多核CPU的性能,以多线程的形式实现服务器,并实现线程池避免线程频繁创建销毁造成的系统开销
  • 实现基于libevent的定时器,用于断开超时连接
  • 增量开发,利用C++继承和虚继承,适当解耦
BSD 3-Clause License Copyright (c) 2021, hsby All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

暂无描述 展开 收起
README
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/scada/ftp_Server.git
git@gitee.com:scada/ftp_Server.git
scada
ftp_Server
X_FTP_SERVER
master

搜索帮助