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

backpressure and webrtc.DataChannel.OnMessage #45

Open
amitu opened this issue Jul 20, 2016 · 1 comment
Open

backpressure and webrtc.DataChannel.OnMessage #45

amitu opened this issue Jul 20, 2016 · 1 comment
Labels

Comments

@amitu
Copy link

amitu commented Jul 20, 2016

How long should a handler attached to webrtc.DataChannel.OnMessage be allowed to take?

If I understand correctly, data channel buffer is drained after OnMessage is returned, so if I am reading from data channel and writing to a slow io.Writer(), I would prefer to block on io.Writer() from my OnMessage handler, but is it advisable for OnMessage to block?

Would it affect other data channels if we have more than one?

@amitu
Copy link
Author

amitu commented Jul 20, 2016

Another question: if I am in the callback, say OnMessage, can I call methods on dc before I return from it? Eg read the dc.ReadyState(), or call dc.Send() on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants