code: func (c *DeliverConnection) Receive(eventch chan<- interface{}) {
  	for {
  		stream := c.deliverStream()
  		if stream == nil {
  			logger.Warn("The stream has closed. Terminating loop.")
  			break
  		}
  
  		in, err := stream.Recv()
  
  		logger.Debugf("Got deliver response: %#v", in)
  
  		if c.Closed() {
  			logger.Debugf("The connection has closed with error [%s]. Terminating loop.", err)
  			break
  		}
  
  		if err == io.EOF {
  			// This signifies that the stream has been terminated at the client-side. No need to send an event.
  			logger.Debug("Received EOF from stream.")
  			break
  		}
  
  		if err != nil {
  			logger.Warnf("Received error from stream: [%s]. Sending disconnected event.", err)
  			eventch <- clientdisp.NewDisconnectedEvent(err)
  			break
  		}
  
  		eventch <- NewEvent(in, c.url)
  	}
  	logger.Debug("Exiting stream listener")
  }
docs: // Receive receives events from the deliver server