+ m.contextMux.Unlock()
+ if j+1 <= m.maxRetryOnFailure && txBuffer != nil && txBuffer.state == C.RMR_ERR_RETRY {
+ m.UpdateStatCounter("TransmitRetry")
+ continue
+ }
+ break
+ }
+
+ if txBuffer == nil {
+ m.UpdateStatCounter("TransmitError")
+ m.LogMBufError("SendBuf failed", txBuffer)
+ return int(C.RMR_ERR_INITFAILED)
+ }
+
+ if txBuffer.state != C.RMR_OK {
+ m.UpdateStatCounter("TransmitError")
+ m.LogMBufError("SendBuf failed", txBuffer)
+ } else {
+ m.UpdateStatCounter("Transmitted")
+ }
+ defer m.Free(txBuffer)
+ return int(txBuffer.state)
+
+}
+
+func (m *RMRClient) SendCallMsg(params *RMRParams) (int, string) {
+ var (
+ currBuffer *C.rmr_mbuf_t
+ counterName string = "Transmitted"
+ )
+ txBuffer := m.CopyBuffer(params)
+ if txBuffer == nil {
+ return C.RMR_ERR_INITFAILED, ""
+ }
+
+ txBuffer.state = 0
+
+ m.contextMux.Lock()
+ currBuffer = C.rmr_wh_call(m.context, C.int(params.Whid), txBuffer, C.int(params.Callid), C.int(params.Timeout))
+ m.contextMux.Unlock()
+
+ if currBuffer == nil {
+ m.UpdateStatCounter("TransmitError")
+ return m.LogMBufError("SendBuf failed", txBuffer), ""