Azure / DotNetty

DotNetty project – a port of netty, event-driven asynchronous network application framework
Other
4.1k stars 979 forks source link

Using serial communication #612

Open tomuGo opened 1 year ago

tomuGo commented 1 year ago

Our project used TCP communication before, and we have implemented LengthFieldBasedFrameDecoder and MessageToByteEncoder to parse and send data. But now we need to use serial communication, but we still want to use the code of LengthFieldBasedFrameDecoder and MessageToByteEncoder. is there any solution? thanks

fishjimi commented 9 months ago

Im going do USB communication , after research the code , I think DotNetty is abstract enough.

bootstrap
    .Group(group)
    /* Maybe you can try to implement your own SerialSocketChannel, and I need to implement my UsbSocketChannel */
    .Channel<TcpSocketChannel>() 
    .....
    .Handler(new ActionChannelInitializer<ISocketChannel>(channel =>
    {
        ...
    }));