Skip to content

Commit

Permalink
add Read() and Write() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hkh4n committed Nov 3, 2024
1 parent 6755406 commit 14d0b22
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ type StreamSession struct {
to string
}

// Read reads data from the stream.
func (s *StreamSession) Read(buf []byte) (int, error) {
return s.conn.Read(buf)
}

// Write sends data over the stream.
func (s *StreamSession) Write(data []byte) (int, error) {
return s.conn.Write(data)
}

func (s *StreamSession) SetDeadline(t time.Time) error {
log.WithField("deadline", t).Debug("Setting deadline for StreamSession")
return s.conn.SetDeadline(t)
Expand Down

0 comments on commit 14d0b22

Please sign in to comment.