From 2f3a1934acdebdce7780067a13f37481ef77657e Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 31 Oct 2022 10:32:22 +0000 Subject: [PATCH] implement the SetDeadline method on the stream --- stream.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/stream.go b/stream.go index 816bca9..71dc81b 100644 --- a/stream.go +++ b/stream.go @@ -166,9 +166,12 @@ func (s *stream) closeWithSession() { } func (s *stream) SetDeadline(t time.Time) error { - // TODO: implement - return nil - // return maybeConvertStreamError(s.SendStream.SetDeadline(t)) + err1 := s.sendStream.SetWriteDeadline(t) + err2 := s.receiveStream.SetReadDeadline(t) + if err1 != nil { + return err1 + } + return err2 } func maybeConvertStreamError(err error) error {