func (c *Client) readRequest(r *bufio.Reader) (req server.ReqID, err error) { reqs, err := r.ReadString(' ') if err != nil { return 0, err } id, err := strconv.ParseUint(reqs[:len(reqs)-1], 10, 64) return server.ReqID(id), err }
func (c *Client) reqID() server.ReqID { return server.ReqID(atomic.AddUint64(&c.req, 1)) }