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

v2 Plans #314

Open
edaniels opened this issue Mar 6, 2024 · 5 comments
Open

v2 Plans #314

edaniels opened this issue Mar 6, 2024 · 5 comments
Assignees

Comments

@edaniels
Copy link
Member

edaniels commented Mar 6, 2024

@enobufs, I figured we could start talking here publicly about what we should do in v2.

Right now we know that ultimately we want:

  • RACK
  • TLP
  • Blocking writes

The first two make sense to me and can likely be done without an official v2. Blocking writes however is a breaking change and I was curious if you had some ideas in your head on what a newer architecture would look like? I know you mentioned that you don't love the current state machine.

I figure we can start here and try to outline the general idea of what we should do. I don't think the plan has to be hyper specific but it would be good to be on the same page and be able to define units of work that don't result in just some massive PR to get to v2 (unless that is truly the best way!).

Also, anyone else interested in this project, if you have thoughts and opinions on how we achieve the above, please chime in!

@edaniels
Copy link
Member Author

edaniels commented Mar 6, 2024

Also, for what it's worth, I don't think we're in any rush here, so no pressure to respond ASAP to this.

@enobufs
Copy link
Member

enobufs commented Mar 6, 2024

I'd recommend to focus on just blocking writes for v2.
I am aware there are other desired API change such as Listen, Dial (to align with the standard SCTP API) but I think these are "nice to have" features imo and we can do it later. Also, yes RACK/TLP does not require API change.

Many users have been suffering from the async write and the blocking write is the most wanted feature atm. The streamlined goal with v2 make it more achievable to put it into pion/webrtc v4. (getting rid of pendingQueue out of the way for the future enhancement is also nice)

@edaniels
Copy link
Member Author

edaniels commented Mar 6, 2024

That's fine with me. Do you have any vision for what you'd re-architect to achieve blocking writes? I could "just" go down a proof of concept route to achieve and see what changes fall out. What do you think?

@enobufs
Copy link
Member

enobufs commented Mar 6, 2024

I see (or hope) not much re-architing required here. sctp.Stream is already looks like net.Conn. We have two goroutines: writeLoop and readLoop, which wouldn't change. Read operation is already blocking, so it is Stream.WriteSCTP() (<-- I'd remove this method btw..) and underlying call into Association needs to be modified. I'd say we can just use Association's mutex to block the write operation (Association.sendPayloadData()). A challenge I can see from top of my head is because we have many streams competing over the shared Association, we'd need to figure out how to control the deadlines (e.g. SetDeadline, SetWriteDeadline). We'd need a small/short-lived timer routine for each blocking call...

This is my quick thought (I may be wrong). I think it is good idea for you to just go ahead try it out ;)

@edaniels
Copy link
Member Author

edaniels commented Mar 6, 2024

I'll give it a go once some of my paid work lets up :D

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

2 participants