Git Product home page Git Product logo

bigfiletransfer's Introduction

BigFileTransfer

利用Netty进行大文件传输(zero-copy)

使用Netty自带的ChunkedWriteHandler在客户端和服务器之间传输超大文件

write()方法,将数据包装成PendingWrite塞入发送队列

flush()方法,从发送队列取出数据(如果是ChunkedInput类型的数据,同时根据isEndOfInput()方法,判断stream中是否还有数据), 将其发送到对应的channel中,该过程如果发生阻塞,通过注册监听以及channelWritabilityChanged()方法在通道可写的情况下继续发送。

> ByteBuf > inbound > FileReceiveHandler > FileSendHandler > FilePacketHandler
如果是文件内容直接读取 使用FileRegion直接发送文件内容 获取接收文件的属性

该项目操作流程:

  1. 开启服务端(Server)
  2. 开启客户端(Client),完成与服务端连接
  3. 输入文件路径,完成从client->server/server->client的文件发送

有问题可以联系[email protected]交流学习

bigfiletransfer's People

Contributors

zhangji-hhu avatar dependabot[bot] avatar zouyonghao avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.