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

Allow different streamHandlers for different QuicConnections #771

Open
hirshi001 opened this issue Jan 15, 2025 · 1 comment
Open

Allow different streamHandlers for different QuicConnections #771

hirshi001 opened this issue Jan 15, 2025 · 1 comment

Comments

@hirshi001
Copy link

For instance, I have a class called Connection. A new Connection is created for every QuicChannel created, therefore each Connection has an instance of a QuicChannel. However, when a QuicStreamChannel is created, while it is possible to get the associated QuicChannel via parent(), is becomes uncessarily annoying to get the QuicChannel's associated Connection.

While it is possible by using a map, I think the fundamental problem is that the same streamHandler is to be used even for different QuicChannel. I think it would be better to allow a new streamHandler to be for each different QuicChannel, for example using something like:

 ChannelHandler codec = new QuicServerCodecBuilder()
                .... other options
                .handler(new ChannelInitializer<QuicChannel>() {
                    @Override
                    public void initChannel(QuicChannel channel) {
                       channel.pipeline().addLast(...)
                       channel.streamHandler(...)
                    }
              }
@normanmaurer
Copy link
Member

@hirshi001 not sure I get what the problem here is but why not just use a ChannelInitializer as streamHandler ? This is the same concept as we use for different connections etc.

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

No branches or pull requests

2 participants