dotnet-libp2p icon indicating copy to clipboard operation
dotnet-libp2p copied to clipboard

Add request-response protocol

Open flcl42 opened this issue 1 year ago • 1 comments

Protocol

Generic request-response protocol, to be used as base for user define protocols with custom id, request and response types serialized with protobuf

Details

  • Type: app layer protocol

  • Spec: user:

    • implements custom handling logic that receives REQUEST type and returns object of RESPONSE type;
    • defines protocol id,
    • registers protocol

    listener:

    • accepts a connection,
    • receives data,
    • de-serializes it into REQUEST type,
    • allows handling logic to process the request,
    • sends serialized response to dialer and
    • closes the connection

    dialer:

    • allows to send custom request and receive response using particular DialAsync method override

TODO

  • [ ] Implement generic protocol, that implements ISessionProtocol<TRequest, TResponse> protocol;
  • [ ] Add a generic extension method that receives logic handling method, protocol id; and registers protocol as AddAppLayerProtocol does
  • [ ] Add docs
  • [ ] Add tests

flcl42 avatar Feb 26 '25 13:02 flcl42

Could you please assign this to me? I'd like to take a look

etimofeeva avatar Mar 09 '25 11:03 etimofeeva

Hi, is this issue in active developement?

lucafabbri avatar Jun 03 '25 07:06 lucafabbri

@lucafabbri hello, nop, feel free to pick it

flcl42 avatar Jun 03 '25 08:06 flcl42

@flcl42 please, assign to me and I'll start working on it if nobody's against

m33x7 avatar Jul 04 '25 21:07 m33x7

@flcl42 : Hi Aleksey. As discussed @namay26 will be working on interop engineering between dotnet-libp2p and py-libp2p. He has made key contributions to py-libp2p in the past.

As a starting project assignment in dotnet-libp2p, I am asking him to contribute to it while working with us.

@namay26 : Please reach out to us on dotnet-libp2p discord if you encounter any issues.

seetadev avatar Aug 05 '25 09:08 seetadev

Sure, thank you for assigning the issue, will soon share the progress.

namay26 avatar Aug 06 '25 16:08 namay26