Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Setting Parent Channel for EmbeddedChannel #9228

Closed
ryanoneill opened this issue Jun 6, 2019 · 3 comments · Fixed by #9230
Closed

Support Setting Parent Channel for EmbeddedChannel #9228

ryanoneill opened this issue Jun 6, 2019 · 3 comments · Fixed by #9230
Milestone

Comments

@ryanoneill
Copy link

Expected behavior

It would be beneficial for testing the effects of Netty multiplexed protocols (i.e. HTTP/2) on generic functionality if EmbeddedChannel had the capability for setting a parent Channel. There are situations where the child Channel and ChannelPipeline is processing a message, yet the desired information is actually contained within the parent Channel that is responsible for managing the connection (e.g. when trying to determine whether an SslHandler is being used on this connection).

Actual behavior

EmbeddedChannel extends AbstractChannel but always sets the parent Channel for the AbstractChannel constructor to 'null'.

Steps to reproduce

Minimal yet complete reproducer code (or URL to code)

Netty version

4.1.35

JVM version (e.g. java -version)

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

OS version (e.g. uname -a)

Darwin xxxxx 17.7.0 Darwin Kernel Version 17.7.0: Wed Apr 24 21:17:24 PDT 2019; root:xnu-4570.71.45~1/RELEASE_X86_64 x86_64

@normanmaurer
Copy link
Member

@ryanoneill sounds good... want to do a pr ?

@ryanoneill
Copy link
Author

Would like to, I just need to find the time. It might be a few weeks before I could do it. What do you think?

normanmaurer added a commit that referenced this issue Jun 7, 2019
Motivation:

Sometimes it is beneficial to be able to set a parent Channel in EmbeddedChannel if the handler that should be tested depend on the parent.

Modifications:

- Add another constructor which allows to specify a parent
- Add unit tests

Result:

Fixes #9228.
@normanmaurer
Copy link
Member

@ryanoneill just had a few minutes and so did it... PTAL #9230

normanmaurer added a commit that referenced this issue Jun 8, 2019
Motivation:

Sometimes it is beneficial to be able to set a parent Channel in EmbeddedChannel if the handler that should be tested depend on the parent.

Modifications:

- Add another constructor which allows to specify a parent
- Add unit tests

Result:

Fixes #9228.
normanmaurer added a commit that referenced this issue Jun 8, 2019
Motivation:

Sometimes it is beneficial to be able to set a parent Channel in EmbeddedChannel if the handler that should be tested depend on the parent.

Modifications:

- Add another constructor which allows to specify a parent
- Add unit tests

Result:

Fixes #9228.
@normanmaurer normanmaurer added this to the 4.1.37.Final milestone Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants