Skip to content

Conversation

@lucafabbri
Copy link

It implements a ChannelStream that wraps an IChannel.

The implementation does not touch the IChannel interface, even if some Stream abstraction can't be implemented without exposing some more information out of the IChannel interface.

Feature Supported
Write yes
WriteAsync yes
Read yes
ReadAsync yes
Flush no
Seek no

@lucafabbri lucafabbri requested review from flcl42 and rubo as code owners June 3, 2025 07:48
@lucafabbri
Copy link
Author

Refers #127

@flcl42
Copy link
Contributor

flcl42 commented Jun 5, 2025

Hello @lucafabbri ! The code looks great, just few notes:

Could you check src\libp2p\Libp2p.Core\Stream.cs? It contains some logic that may be useful for your implementation, it has more detailed handling of CanRead/CanWrite. it also implements such expected feature of streams: if there is noting yet to read it blocks until we have at least something. It returns immediately only if channel is closed for reading.
Could you remove that old implementation in favor of your one?

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 this pull request may close these issues.

2 participants