pion / srtp

A Go implementation of SRTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose "SetReadDeadline" and "SetDeadline" from this package

mission-liao opened this issue · comments

Summary

  • Expose SetReadDeadline from ReadStreamSRTP and ReadStreamSRTCP.
  • Expose SetWriteDeadline from WriteStreamSRTP and WriteStreamSRTCP

Motivation

To make the packet I/O of pion/webrtc cancelable without closing peer-connection, including RTP and RTCP packets.

Additional context

I've spent some time to trace this package, and below is an implementation plan. Please kindly correct me if it's wrong.

  • expose SetReadDeadline for ReadStreamSRTP via ReadStreamSRTP.buffer.
  • expose SetReadDeadline for ReadStreamSRTCP via ReadStreamSRTCP.buffer.
  • expose SetWriteDeadline for WriteStreamSRTP via session.nextConn.
  • expose SetWriteDeadline for WriteStreamSRTCP via session.nextConn.

What I didn't investigate is the way to test the implementation, feel free to give me some advise/reference if any.

@Sean-Der would love to get your feedback and take over the implementation part.

@mission-liao I am 100% in support of this! This is an instant merge from me :)

Test wise I think it is ok to set a Timelimit on the test 5 seconds and set a small ReadDeadline. If the test times out it will cause a fail.

Cool, would integrate this part to pion/webrtc package later.