public void add_handler(Socket sock, int fd, Action<int, int> handler, int events)
{
// Registers the given handler to receive the given events for fd.
_handlers[fd] = handler; //todo stack_context.wrap(handler);
_impl.register(sock, fd, events | ERROR);
}