【问题标题】:how to convert request from byte[] to ByteBuf and send it to server using Netty如何将请求从 byte[] 转换为 ByteBuf 并使用 Netty 将其发送到服务器
【发布时间】:2017-01-11 21:39:47
【问题描述】:

我是netty的新手,我正在尝试使用netty CLIENT向TCP服务器发送请求,我的TCP服务器只接受字节数组,如何发送字节数组作为请求并从TCP服务器获取响应。

【问题讨论】:

  • 分享一些代码,例如服务器的inboundhandler。

标签: netty


【解决方案1】:

只需使用Unpooled.wrappedBuffer(bytearray)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-05
    • 1970-01-01
    • 1970-01-01
    • 2020-05-26
    • 2019-01-07
    • 2012-11-08
    相关资源
    最近更新 更多