Example #1
0
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
}
Example #2
0
func (c *Client) reqID() server.ReqID {
	return server.ReqID(atomic.AddUint64(&c.req, 1))
}