31 : _maxretry(maxretry), _out_seqno(1), _in_seqno(0), _ack_seqno(0), _count(0), _timeout(timeout)
46 std::vector<char> sendbuf(length + 2);
52 sendbuf[1] = _out_seqno; _out_seqno++;
55 char *sendptr = ((
char*)&sendbuf[0]) + 2;
56 ::memcpy(sendptr, buffer, length);
59 if (
__send_impl((
char*)&sendbuf[0], length + 2) != 0)
67 while (_ack_seqno != _out_seqno)
70 _ack_cond.
wait(_timeout);
78 if ((_maxretry > 0) && (_count > _maxretry))
84 if (
__send_impl((
char*)&sendbuf[0], length + 2) != 0)
103 char *bufferptr = buffer;
108 if (ret != 0)
return ret;
111 char msgtype = *bufferptr; bufferptr++;
114 uint8_t seqno = *bufferptr; bufferptr++;
117 if (seqno > _in_seqno)
125 ::memcpy(buffer, bufferptr, length - 2);