diff --git a/uasc/secure_channel.go b/uasc/secure_channel.go index 960a5c39..4f3d0ddd 100644 --- a/uasc/secure_channel.go +++ b/uasc/secure_channel.go @@ -340,7 +340,8 @@ func (s *SecureChannel) receive(ctx context.Context) *response { func (s *SecureChannel) readChunk() (*MessageChunk, error) { // read a full message from the underlying conn. b, err := s.c.Receive() - if err == io.EOF || len(b) == 0 { + + if err == io.EOF || err == nil && len(b) == 0 { return nil, io.EOF } // do not wrap this error since it hides conn error