Example #1
0
File: cmd.c Project: embedthis/mpr
PUBLIC void mprEnableCmdOutputEvents(MprCmd *cmd, bool on)
{
    int     mask;

    mask = on ? MPR_READABLE : 0;
    if (cmd->handlers[MPR_CMD_STDOUT]) {
        mprWaitOn(cmd->handlers[MPR_CMD_STDOUT], mask);
    }
    if (cmd->handlers[MPR_CMD_STDERR]) {
        mprWaitOn(cmd->handlers[MPR_CMD_STDERR], mask);
    }
}
Example #2
0
File: cmd.c Project: embedthis/mpr
PUBLIC void mprEnableCmdEvents(MprCmd *cmd, int channel)
{
    int mask = (channel == MPR_CMD_STDIN) ? MPR_WRITABLE : MPR_READABLE;
    if (cmd->handlers[channel]) {
        mprWaitOn(cmd->handlers[channel], mask);
    }
}
Example #3
0
PUBLIC void httpSetupWaitHandler(HttpConn *conn, int eventMask)
{
    MprSocket   *sp;

    sp = conn->sock;
    if (eventMask) {
        if (sp->handler == 0) {
            mprAddSocketHandler(sp, eventMask, conn->dispatcher, conn->ioCallback, conn, 0);
        } else {
            mprSetSocketDispatcher(sp, conn->dispatcher);
            mprEnableSocketEvents(sp, eventMask);
        }
    } else if (sp->handler) {
        mprWaitOn(sp->handler, eventMask);
    }
}
Example #4
0
File: cmd.c Project: embedthis/mpr
PUBLIC void mprDisableCmdEvents(MprCmd *cmd, int channel)
{
    if (cmd->handlers[channel]) {
        mprWaitOn(cmd->handlers[channel], 0);
    }
}