int nn_pipebase_start (struct nn_pipebase *self) { int rc; nn_assert (self->state == NN_PIPEBASE_STATE_IDLE); self->state = NN_PIPEBASE_STATE_ACTIVE; self->instate = NN_PIPEBASE_INSTATE_ASYNC; self->outstate = NN_PIPEBASE_OUTSTATE_IDLE; rc = nn_sock_add (self->sock, (struct nn_pipe*) self); if (nn_slow (rc < 0)) return rc; if (self->sock) nn_fsm_raise (&self->fsm, &self->out, NN_PIPE_OUT); return 0; }
int nn_pipebase_start (struct nn_pipebase *self) { int rc; nn_assert_state (self,NN_PIPEBASE_STATE_IDLE); self->state = NN_PIPEBASE_STATE_ACTIVE; self->instate = NN_PIPEBASE_INSTATE_ASYNC; self->outstate = NN_PIPEBASE_OUTSTATE_IDLE; rc = nn_sock_add(self->sock,(struct nn_pipe *)self); PNACL_msg("nn_pipebase_start self.%p rc.%d\n",self,rc); if ( nn_slow(rc < 0) ) { self->state = NN_PIPEBASE_STATE_FAILED; return rc; } if ( self->sock ) nn_fsm_raise(&self->fsm,&self->out,NN_PIPE_OUT); return 0; }