libp2p / libp2p/jvm-libp2p

addProtocolHandler() doesn't work as expected

Open
#176 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
366
Forks
85
Avg merge
2d 39m
Merged PRs (30d)
6

Description

I wrote a custom stream protocol by extending ProtocolHandler and created a strict binding to my id.

The problem.

It works when I add it while building the host
protocols{
+myprotocolbinding()
}

all stream ops are working as expected.

but when I attach it at runtime with the help of addProtocolhandler() -> Exception while protocol is negotiated. (while resolving controller future)

Am I missing something?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the custom ProtocolHandler with a strict binding, comparing host-time registration through protocols{myprotocolbinding()} with runtime addProtocolHandler(). Trace the protocol negotiation and controller future resolution paths; done means stream operations work in both registration modes without an exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.