hashicorp / yamux

Golang connection multiplexing library
Mozilla Public License 2.0
2.25k stars 236 forks source link

Add timeout support to stream acceptance #47

Closed pjvds closed 2 years ago

pjvds commented 7 years ago

Add timeout support to stream acceptance:

stream, err := s.AcceptStreamWithTimeout(50 * time.Millisecond)

We use this to accept streams within a certain time or close the connection. It will block forever when called with an zero duration. Timers will be closed so it is recovered by the garbage collector even if the timer has not been fired yet.

hashicorp-cla commented 5 years ago

CLA assistant check
All committers have signed the CLA.

evanphx commented 2 years ago

I'd prefer to handle this with #80 since a context can be enhanced with a timeout itself.