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

API Design: LP2PQuicTransport listener #32

Closed
backkem opened this issue Dec 29, 2023 · 1 comment
Closed

API Design: LP2PQuicTransport listener #32

backkem opened this issue Dec 29, 2023 · 1 comment

Comments

@backkem
Copy link
Collaborator

backkem commented Dec 29, 2023

While experimenting a bit with the current LP2PQuicTransport API a couple notes came up.

Since the ontransport EventHandler is on LP2PReceiver, this implies only a LP2P receiver side can currently listen for a QuicTransport. On the other hand, allowing a QuicTransport to be constructed from an existing connection doesn't enforce this limitation.

There's a couple ways I can see to amend this:

  • Let constructing a transport from an existing connection throw an error on the receiving side. However, this would not be easily inferred from the API signature, it would have to be documented.
  • Remove the constructor over a connection and keep the one-sided setup on LP2PReceiver.
  • Add ontransport to both LP2PReceiver, LP2PRequester.
  • Create a separate QuicTransportListener object. Allow both the listener and QuicTransport to be constructed from the LP2PReceiver, LP2PRequester and LP2PConnection. This seems the cleanest but slightly more verbose. Since this means moving the ontransport to the QuicTransportListener, it can also address API Design: EventHandler vs ReadableStream #30 by turning it into a ReadableStream instead.
@backkem
Copy link
Collaborator Author

backkem commented Jan 9, 2024

Solved by #33.

@backkem backkem closed this as completed Jan 9, 2024
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

1 participant