static void nn_req_out (struct nn_sockbase *self, struct nn_pipe *pipe) { struct nn_req *req; req = nn_cont (self, struct nn_req, xreq.sockbase); /* Add the pipe to the underlying raw socket. */ nn_xreq_out (&req->xreq.sockbase, pipe); /* Notify the state machine. */ if (req->state == NN_REQ_STATE_DELAYED) nn_fsm_action (&req->fsm, NN_REQ_ACTION_OUT); }
static void nn_req_out (struct nn_sockbase *self, struct nn_pipe *pipe) { int rc; struct nn_req *req; struct nn_msg msg; req = nn_cont (self, struct nn_req, xreq.sockbase); /* Add the pipe to the underlying raw socket. */ nn_xreq_out (&req->xreq.sockbase, pipe); /* If the current request was not sent yet, send it now. */ if (req->state == NN_REQ_STATE_UNSENT) { nn_msg_cp (&msg, &req->request); rc = nn_xreq_send (&req->xreq.sockbase, &msg); errnum_assert (rc == 0, -rc); req->state = NN_REQ_STATE_SENT; } }