C++ Code doesn't work

Suhoparov Stanislav s.suhoparov at rambler-co.ru
Thu Sep 25 11:31:02 CEST 2008


Hello, why this code doesn't work. Poll loop doesn't start.

// ------------------- Code -----------------

#include <ev++.h>

#include <stdio.h>

using namespace ev;

void io_cb (ev::io &w, int revents);

 

class myclass

{

public:

   ev::io iow;  

   myclass (int fd)

   {

       iow.set <myclass, &myclass::io_cb> (this);

       iow.start (fd, ev::WRITE | ev::READ);

   }

   void io_cb (ev::io &w, int revents) {

               puts("test");

   }

};

 

int main( int /*argc*/, char** /*argv*/ )

{

    myclass *obj = new myclass(fileno(stdin));

    return 0;

}

// --------------------- EOF -----------------------

 

Thanks.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20080925/4fa85dca/attachment.html>


More information about the libev mailing list