Esempio n. 1
0
static DFBResult
server_run()
{
    DFBResult     ret;
    VoodooServer *server;

    ret = voodoo_server_create( &server );
    if (ret) {
        D_ERROR( "Voodoo/Proxy: Could not create the server (%s)!\n", DirectFBErrorString(ret) );
        return ret;
    }

    ret = voodoo_server_register( server, "IDirectFB", ConstructDispatcher, NULL );
    if (ret) {
        D_ERROR( "Voodoo/Proxy: Could not register super interface 'IDirectFB'!\n" );
        voodoo_server_destroy( server );
        return ret;
    }

    ret = voodoo_server_run( server );
    if (ret)
        D_ERROR( "Voodoo/Proxy: Server exiting with error (%s)!\n", DirectFBErrorString(ret) );

    voodoo_server_destroy( server );

    return DFB_OK;
}
Esempio n. 2
0
int
main( int argc, char *argv[] )
{
     DirectResult     ret;
     VoodooTestServer test = {0};

     ret = voodoo_server_create( "127.0.0.1", 23456, false, &test.server );
     if (ret) {
          D_DERROR( ret, "voodoo_server_create() failed!\n" );
          return ret;
     }

     voodoo_server_register( test.server, "VoodooTest", VoodooTestConstruct, &test /* context pointer */ );


     D_INFO( "Voodoo/Test: Running server...\n" );

     voodoo_server_run( test.server );

     voodoo_server_destroy( test.server );

     return 0;
}