code: func (c *msgpackCodec) Write(m *codec.Message, b interface{}) error {
  	switch m.Type {
  	case codec.Request:
  		h := Request{
  			ID:     m.Id,
  			Method: m.Endpoint,
  			Body:   b,
  		}
  
  		return msgp.Encode(c.rwc, &h)
  
  	case codec.Response:
  		h := Response{
  			ID:   m.Id,
  			Body: b,
  		}
  
  		h.Error = m.Error
  
  		return msgp.Encode(c.rwc, &h)
  
  	case codec.Publication:
  		h := Notification{
  			Method: m.Endpoint,
  			Body:   b,
  		}
  
  		return msgp.Encode(c.rwc, &h)
  
  	default:
  		return fmt.Errorf("Unrecognized message type: %v", m.Type)
  	}
  }
docs: // Write writes a message to the wire which contains the header followed by the body.
  // The body is assumed to satisfy the msgp.Encodable interface.