- C.write_bytes_array(buf.payload, datap, buf.len)
-
- return m.SendBuf(buf, isRts)
-}
-
-func (m *RMRClient) SendBuf(txBuffer *C.rmr_mbuf_t, isRts bool) bool {
- defer C.rmr_free_msg(txBuffer)
- var currBuffer *C.rmr_mbuf_t
-
- for i := 0; i < 10; i++ {
- txBuffer.state = 0
- if isRts {
- currBuffer = C.rmr_rts_msg(m.context, txBuffer)
- } else {
- currBuffer = C.rmr_send_msg(m.context, txBuffer)
- }
-
- if currBuffer == nil {
- break
- } else if currBuffer.state != C.RMR_OK {
- if currBuffer.state != C.RMR_ERR_RETRY {
- time.Sleep(100 * time.Microsecond)
- m.UpdateStatCounter("TransmitError")
- }
- for j := 0; j < 100 && currBuffer.state == C.RMR_ERR_RETRY; j++ {
- currBuffer = C.rmr_send_msg(m.context, txBuffer)
- }
- }
+ C.write_bytes_array(txBuffer.payload, datap, txBuffer.len)
+
+ txBuffer.state = 0
+ currBuffer := txBuffer
+ if isRts {
+ currBuffer = C.rmr_rts_msg(m.context, txBuffer)
+ } else {
+ currBuffer = C.rmr_send_msg(m.context, txBuffer)
+ }