Azure / Azure/DotNetty

EmbeddedChannel is working incorrectly.

Open
#388 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

As I mentioned in #196, I use EmbeddedChannel to encode and decode Protobuf and the opcode.
But it seems that the implementation in DotNetty is different or with some bug.
In Java, both are working.

DimensionStoryDecoder is a MessageToMessageDecoder.

```
private EmbeddedChannel _embeddedChannel1 = new EmbeddedChannel();

public object Decode(ByteString message)
{
_embeddedChannel1.Pipeline.AddLast(new DimensionStoryDecoder());
_embeddedChannel1.WriteInbound(Unpooled.WrappedBuffer(message.ToByteArray()));
return _embeddedChannel1.ReadInbound();
}
```
This case is not working. Decode method is not called. I mean when I call Decode, the Decode in DimensionStoryDecoder is not called.

```
private EmbeddedChannel _embeddedChannel1 = new EmbeddedChannel(new DimensionStoryDecoder());

public object Decode(ByteString message)
{
_embeddedChannel1.WriteInbound(Unpooled.WrappedBuffer(message.ToByteArray()));
return _embeddedChannel1.ReadInbound();
}
```
This case is working. Decode method is called.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.