Ejemplo n.º 1
0
void nn_aws_term (struct nn_aws *self)
{
    nn_assert_state (self, NN_AWS_STATE_IDLE);

    nn_list_item_term (&self->item);
    nn_fsm_event_term (&self->done);
    nn_fsm_event_term (&self->accepted);
    nn_sws_term (&self->sws);
    nn_usock_term (&self->usock);
    nn_fsm_term (&self->fsm);
}
Ejemplo n.º 2
0
Archivo: aipc.c Proyecto: antmd/nanomsg
void nn_aipc_term (struct nn_aipc *self)
{
    nn_assert (self->state == NN_AIPC_STATE_IDLE);

    nn_list_item_term (&self->item);
    nn_fsm_event_term (&self->done);
    nn_fsm_event_term (&self->accepted);
    nn_sipc_term (&self->sipc);
    nn_usock_term (&self->usock);
    nn_fsm_term (&self->fsm);
}
Ejemplo n.º 3
0
void nn_atcp_term (struct nn_atcp *self)
{
    nn_assert_state (self, NN_ATCP_STATE_IDLE);

    nn_list_item_term (&self->item);
    nn_fsm_event_term (&self->done);
    nn_fsm_event_term (&self->accepted);
    nn_stcp_term (&self->stcp);
    nn_usock_term (&self->usock);
    nn_fsm_term (&self->fsm);
}
Ejemplo n.º 4
0
static void nn_binproc_destroy (struct nn_epbase *self)
{
    struct nn_binproc *binproc;

    binproc = nn_cont (self, struct nn_binproc, epbase);

    nn_list_item_term (&binproc->item);
    nn_list_term (&binproc->sinprocs);
    nn_fsm_term (&binproc->fsm);
    nn_epbase_term (&binproc->epbase);

    nn_free (binproc);
}
Ejemplo n.º 5
0
static void nn_astream_terminating_closed (const struct nn_cp_sink **self,
    struct nn_usock *usock)
{
    struct nn_astream *astream;

    astream = nn_cont (self, struct nn_astream, sink);

    /*  Ignore if I don't belong to the bstream. */
    if (nn_list_item_isinlist (&astream->item))
        nn_bstream_astream_closed (astream->bstream, astream);

    nn_list_item_term (&astream->item);
    nn_free (astream);
}
Ejemplo n.º 6
0
Archivo: ep.c Proyecto: WongTai/nanomsg
int nn_ep_init (struct nn_ep *self, int src, struct nn_sock *sock, int eid,
    struct nn_transport *transport, int bind, const char *addr)
{
    int rc;

    nn_fsm_init (&self->fsm, nn_ep_handler, nn_ep_shutdown,
        src, self, &sock->fsm);
    self->state = NN_EP_STATE_IDLE;

    self->epbase = NULL;
    self->sock = sock;
    self->eid = eid;
    self->last_errno = 0;
    nn_list_item_init (&self->item);
    memcpy (&self->options, &sock->ep_template, sizeof(struct nn_ep_options));

    /*  Store the textual form of the address. */
    nn_assert (strlen (addr) <= NN_SOCKADDR_MAX);
#if defined _MSC_VER
#pragma warning (push)
#pragma warning (disable:4996)
#endif
    strcpy (self->addr, addr);
#if defined _MSC_VER
#pragma warning (pop)
#endif

    /*  Create transport-specific part of the endpoint. */
    if (bind)
        rc = transport->bind ((void*) self, &self->epbase);
    else
        rc = transport->connect ((void*) self, &self->epbase);

    /*  Endpoint creation failed. */
    if (rc < 0) {
        nn_list_item_term (&self->item);
        nn_fsm_term (&self->fsm);
        return rc;
    }

    return 0;
}
Ejemplo n.º 7
0
Archivo: ins.c Proyecto: 4ker/nanomsg
void nn_ins_item_term (struct nn_ins_item *self)
{
    nn_list_item_term (&self->item);
    nn_epbase_term (&self->epbase);
}
Ejemplo n.º 8
0
void nn_ins_item_term (struct nn_ins_item *self)
{
    nn_list_item_term (&self->item);
}