code: func (c *msgpackCodec) ReadHeader(m *codec.Message, mt codec.MessageType) error {
  	c.mt = mt
  
  	switch mt {
  	case codec.Request:
  		var h Request
  
  		if err := msgp.Decode(c.rwc, &h); err != nil {
  			return err
  		}
  
  		c.body = h.hasBody
  		m.Id = h.ID
  		m.Endpoint = h.Method
  
  	case codec.Response:
  		var h Response
  
  		if err := msgp.Decode(c.rwc, &h); err != nil {
  			return err
  		}
  
  		c.body = h.hasBody
  		m.Id = h.ID
  		m.Error = h.Error
  
  	case codec.Publication:
  		var h Notification
  
  		if err := msgp.Decode(c.rwc, &h); err != nil {
  			return err
  		}
  
  		c.body = h.hasBody
  		m.Endpoint = h.Method
  
  	default:
  		return errors.New("Unrecognized message type")
  	}
  
  	return nil
  }
docs: // ReadHeader reads the header from the wire.