libp2p / jvm-libp2p

a libp2p implementation for the JVM, written in Kotlin 🔥
https://libp2p.io
Apache License 2.0
263 stars 75 forks source link

addProtocolHandler() doesn't work as expected #176

Open SangameswaranRS opened 3 years ago

SangameswaranRS commented 3 years ago

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?

SangameswaranRS commented 3 years ago

I tried writing a UT with Echo() protocol, the same thing is happening. Negotiator.kt -> requestor firesProtocolNegotiationFailed,

Author: @Nashatyrev , any idea if Im missing anything?

Wawa1996 commented 3 years ago

I also had the same problem.