[Click] read handler with parameters

sam barker sam.barker0 at gmail.com
Mon Jan 14 21:11:22 EST 2008


Hi All,
I was trying out the read handler with a parameter and I seem to be stuck.

Basically I wan t to  pass an int parameter to my_func().

After I telnet into the localhost how do I call the function?.
I had used  read readelement_name.a_handle(1);

The the partial code of my .cc file is below


String readelement::handle(Element *e, void *thunk){
    readelement * me = (readelement *) e;

    int *i;
    i=(int *)thunk;
    return me->my_func(i);
}
void readelement::add_handlers(void * thunk){
    add_read_handler("a_handle", &handle, (void *)thunk);
}

Regards,
Sam


More information about the click mailing list