示例代码:https://github.com/netty/netty/blob/4.1/example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java
如果ssl被禁用,它将使用FileRegion而不是ChunkedInput。为什么会这样呢?一个大文件不会破坏代码吗?
谢谢。
发布于 2016-01-15 10:01:42
当ssl被禁用时,结果是调用FileChannel的transferTo()方法。该方法比从通道或ByteBuf的某些包装中读取更有效。当请求被传递到通道时,在这种情况下消息的大小将被设置为0。
https://stackoverflow.com/questions/34804146
相似问题