You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add methods to set deadlines for Read/Write from the datachannel. The underlying SCTP stream has a SetReadDeadline method that can be exposed for setting the Read deadline.
Motivation
The datachannel Read method seems to block until there is data or the channel is closed. To wrap a datachannel in a net.Conn we need to wrap it with the methods to set deadlines, and have the Read/Write calls execute in a separate goroutine. Using the methods already available on the SCTP stream would be efficient and make datachannels easier to use.
Describe alternatives you've considered
To implement SetReadDeadline, we run a loop that uses the current Read call to write to a buffer, and notifies the caller of completion of the Read via a channel. This allows us to await a timer in addition to completion of the Read.
The text was updated successfully, but these errors were encountered:
Summary
Add methods to set deadlines for
Read
/Write
from the datachannel. The underlying SCTP stream has aSetReadDeadline
method that can be exposed for setting theRead
deadline.Motivation
The datachannel
Read
method seems to block until there is data or the channel is closed. To wrap a datachannel in anet.Conn
we need to wrap it with the methods to set deadlines, and have theRead
/Write
calls execute in a separate goroutine. Using the methods already available on the SCTP stream would be efficient and make datachannels easier to use.Describe alternatives you've considered
To implement
SetReadDeadline
, we run a loop that uses the currentRead
call to write to a buffer, and notifies the caller of completion of theRead
via a channel. This allows us to await a timer in addition to completion of theRead
.The text was updated successfully, but these errors were encountered: