func (c *client) handleCommand(msgID []byte, cmd protocol.Command) (err error) { buf := bytes.NewBuffer(nil) buf.Write(msgID) buf.Write(protocol.NullChar) buf.Write(cmd.Bytes()) err = c.conn.Send(buf.Bytes()) return }
func (w *worker) handleCommand(msgId []byte, cmd protocol.Command) (err error) { buf := bytes.NewBuffer(nil) buf.Write(msgId) buf.Write(protocol.NULL_CHAR) buf.Write(cmd.Bytes()) err = w.conn.Send(buf.Bytes()) return }
func (client *Client) HandleCommand(msgId int64, cmd protocol.Command) (err error) { buf := bytes.NewBuffer(nil) buf.WriteString(strconv.FormatInt(msgId, 10)) buf.Write(protocol.NULL_CHAR) buf.Write(cmd.Bytes()) err = client.conn.Send(buf.Bytes()) return }