예제 #1
0
void zmq::object_t::process_command (command_t &cmd_)
{
    switch (cmd_.type) {

    case command_t::revive:
        process_revive ();
        break;

    case command_t::stop:
        process_stop ();
        break;

    case command_t::plug:
        process_plug ();
        process_seqnum ();
        return;

    case command_t::own:
        process_own (cmd_.args.own.object);
        return;

    case command_t::attach:
        process_attach (cmd_.args.attach.engine);
        process_seqnum ();
        return;

    case command_t::bind:
        process_bind (cmd_.args.bind.in_pipe, cmd_.args.bind.out_pipe);
        process_seqnum ();
        return;

    case command_t::pipe_term:
        process_pipe_term ();
        return;

    case command_t::pipe_term_ack:
        process_pipe_term_ack ();
        return;

    case command_t::term_req:
        process_term_req (cmd_.args.term_req.object);
        return;

    case command_t::term:
        process_term ();
        return;

    case command_t::term_ack:
        process_term_ack ();
        return;

    default:
        zmq_assert (false);
    }
}
예제 #2
0
/***********************************************************************
 *           KERNEL initialisation routine
 */
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
    switch(reason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls( hinst );
        return process_attach( hinst );
    case DLL_PROCESS_DETACH:
        WritePrivateProfileSectionW( NULL, NULL, NULL );
        CONSOLE_Exit();
        break;
    }
    return TRUE;
}
예제 #3
0
/***********************************************************************
 *           OpenGL initialisation routine
 */
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
    switch(reason)
    {
    case DLL_PROCESS_ATTACH:
        opengl32_handle = hinst;
        DisableThreadLibraryCalls(hinst);
        return process_attach();
    case DLL_PROCESS_DETACH:
        process_detach();
        break;
    }
    return TRUE;
}
예제 #4
0
파일: macdrv_main.c 프로젝트: AndreRH/wine
/***********************************************************************
 *              DllMain
 */
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
    BOOL ret = TRUE;

    switch(reason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls( hinst );
        macdrv_module = hinst;
        ret = process_attach();
        break;
    }
    return ret;
}
예제 #5
0
/***********************************************************************
 *              DllMain
 */
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
    BOOL ret = TRUE;

    switch(reason)
    {
    case DLL_PROCESS_ATTACH:
        ret = process_attach();
        break;
    case DLL_THREAD_DETACH:
        thread_detach();
        break;
    }
    return ret;
}
예제 #6
0
/***********************************************************************
 *           UserClientDllInitialize  (USER32.@)
 *
 * USER dll initialisation routine (exported as UserClientDllInitialize for compatibility).
 */
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
    BOOL ret = TRUE;
    switch(reason)
    {
    case DLL_PROCESS_ATTACH:
        user32_module = inst;
        ret = process_attach();
        break;
    case DLL_THREAD_DETACH:
        thread_detach();
        break;
    case DLL_PROCESS_DETACH:
        USER_unload_driver();
        break;
    }
    return ret;
}
예제 #7
0
//
// 如何处理各种Command呢?
// 一般用于不同对象之间的通信,包括cross thread的通信
// 各种相关的函数实现已经定义好
//
void zmq::object_t::process_command(command_t &cmd_) {
    switch (cmd_.type) {

        case command_t::activate_read:
            process_activate_read();
            break;

        case command_t::activate_write:
            process_activate_write(cmd_.args.activate_write.msgs_read);
            break;

        case command_t::stop:
            process_stop();
            break;

        case command_t::plug:
            process_plug();
            process_seqnum();
            break;

        case command_t::own:
            process_own(cmd_.args.own.object);
            process_seqnum();
            break;

        case command_t::attach:
            process_attach(cmd_.args.attach.engine);
            process_seqnum();
            break;

        case command_t::bind:
            process_bind(cmd_.args.bind.pipe);
            process_seqnum();
            break;

        case command_t::hiccup:
            process_hiccup(cmd_.args.hiccup.pipe);
            break;

        case command_t::pipe_term:
            process_pipe_term();
            break;

        case command_t::pipe_term_ack:
            process_pipe_term_ack();
            break;

        case command_t::term_req:
            process_term_req(cmd_.args.term_req.object);
            break;

        case command_t::term:
            process_term(cmd_.args.term.linger);
            break;

        case command_t::term_ack:
            process_term_ack();
            break;

        case command_t::reap:
            process_reap(cmd_.args.reap.socket);
            break;

        case command_t::reaped:
            process_reaped();
            break;

        case command_t::inproc_connected:
            process_seqnum();
            break;

        case command_t::done:
        default:
            zmq_assert (false);
    }
}
예제 #8
0
void zmq::object_t::process_command (command_t &cmd_)
{
    switch (cmd_.type) {

    case command_t::revive:
        process_revive ();
        break;

    case command_t::stop:
        process_stop ();
        break;

    case command_t::plug:
        process_plug ();
        process_seqnum ();
        return;

    case command_t::own:
        process_own (cmd_.args.own.object);
        process_seqnum ();
        break;

    case command_t::attach:
        process_attach (cmd_.args.attach.engine,
            blob_t (cmd_.args.attach.peer_identity,
            cmd_.args.attach.peer_identity_size));
        process_seqnum ();
        break;

    case command_t::bind:
        process_bind (cmd_.args.bind.in_pipe, cmd_.args.bind.out_pipe,
            cmd_.args.bind.peer_identity ? blob_t (cmd_.args.bind.peer_identity,
            cmd_.args.bind.peer_identity_size) : blob_t ());
        process_seqnum ();
        break;

    case command_t::reader_info:
        process_reader_info (cmd_.args.reader_info.msgs_read);
        break;

    case command_t::pipe_term:
        process_pipe_term ();
        return;

    case command_t::pipe_term_ack:
        process_pipe_term_ack ();
        break;

    case command_t::term_req:
        process_term_req (cmd_.args.term_req.object);
        break;
    
    case command_t::term:
        process_term ();
        break;

    case command_t::term_ack:
        process_term_ack ();
        break;

    default:
        zmq_assert (false);
    }

    //  The assumption here is that each command is processed once only,
    //  so deallocating it after processing is all right.
    deallocate_command (&cmd_);
}
예제 #9
0
void zmq::object_t::process_command (command_t &cmd_)
{
    switch (cmd_.type) {

    case command_t::activate_read:
        process_activate_read ();
        break;

    case command_t::activate_write:
        process_activate_write (cmd_.args.activate_write.msgs_read);
        break;

    case command_t::stop:
        process_stop ();
        break;

    case command_t::plug:
        process_plug ();
        process_seqnum ();
        break;

    case command_t::own:
        process_own (cmd_.args.own.object);
        process_seqnum ();
        break;

    case command_t::attach:
        process_attach (cmd_.args.attach.engine,
            cmd_.args.attach.peer_identity ?
            blob_t (cmd_.args.attach.peer_identity,
            cmd_.args.attach.peer_identity_size) : blob_t ());
        process_seqnum ();
        break;

    case command_t::bind:
        process_bind (cmd_.args.bind.pipe, cmd_.args.bind.peer_identity ?
            blob_t (cmd_.args.bind.peer_identity,
            cmd_.args.bind.peer_identity_size) : blob_t ());
        process_seqnum ();
        break;

    case command_t::hiccup:
        process_hiccup (cmd_.args.hiccup.pipe);
        break;

    case command_t::pipe_term:
        process_pipe_term ();
        break;

    case command_t::pipe_term_ack:
        process_pipe_term_ack ();
        break;

    case command_t::term_req:
        process_term_req (cmd_.args.term_req.object);
        break;
    
    case command_t::term:
        process_term (cmd_.args.term.linger);
        break;

    case command_t::term_ack:
        process_term_ack ();
        break;

    case command_t::reap:
        process_reap (cmd_.args.reap.socket);
        break;

    case command_t::reaped:
        process_reaped ();
        break;

    default:
        zmq_assert (false);
    }

    //  The assumption here is that each command is processed once only,
    //  so deallocating it after processing is all right.
    deallocate_command (&cmd_);
}