王子豪
王子豪
netty before ` int attemptedBytes = buffer.remaining(); final int localWrittenBytes = ch.write(buffer); if (localWrittenBytes
可以, 我改下。 不过这种模式和servlet的模式冲突(因为servlet要求解析), 我打算加个配置参数,让你可以选择开启或关闭。
你改这一处不够, spring还会调用 getParameter, 导致触发解析body。
改好了,在master分支, 你可以重写spring提供CommonsMultipartResolver的来处理了。 这是这次改动, https://github.com/wangzihaogithub/spring-boot-protocol/commit/603ce3a4159095f6d63b26480145c01cd001fd11 如果你需要在maven中央仓库中, 需要我发新版本,可以直接告诉我,我就发新版了。
需要你从我这的master分支, 同步一下代码. 或者我上传到中央仓库,
idea的git 有个 remote的选项, 把我这个项目加进去, 然后merge into到你的分支就行
可能是文档没写清楚,我刚才补充了一下文档, 你看下这个链接刚补充的文档。 还有/src/test目录下也有代码示例, 有上传下载文件, mqtt等的使用方法。 目前除了http,nrpc。 其他mqtt或其他协议都是默认不开启的。 [https://github.com/wangzihaogithub/spring-boot-protocol/wiki#%E7%A4%BA%E4%BE%8B1-springboot%E7%89%88%E4%BD%BF%E7%94%A8http%E6%88%96websocket%E6%A8%A1%E5%9D%97%E4%BD%BF%E7%94%A8springboot%E5%90%8E%E9%BB%98%E8%AE%A4%E6%98%AF%E5%BC%80%E5%90%AFhttp%E7%9A%84](https://github.com/wangzihaogithub/spring-boot-protocol/wiki#%E7%A4%BA%E4%BE%8B1-springboot%E7%89%88%E4%BD%BF%E7%94%A8http%E6%88%96websocket%E6%A8%A1%E5%9D%97%E4%BD%BF%E7%94%A8springboot%E5%90%8E%E9%BB%98%E8%AE%A4%E6%98%AF%E5%BC%80%E5%90%AFhttp%E7%9A%84)
下面这个问题, 这样用. 我可以返回一个数据list,让 ctx 可以逐个 write吗? 另外返回的数据可以是个 Consumer 吗? , try(NettyOutputStream outputStream = (NettyOutputStream)response.getOutputStream()){ outputStream.write(mappedByteBuffer); outputStream.write(mappedByteBuffer); outputStream.write(mappedByteBuffer); } `package com.github.netty.protocol.servlet; /** * use netty zero copy * if you need...
这个问题, springboot本身就支持. spring怎么用,这里就怎么用. spring的用法是, 在resources包下, 建立静态目录, 访问目录下的文件.index.html即可, 不需要多余的配置 HTML file request 支持,而不仅仅是 servlet.