- control_socket_open = true;
- control_socket_io.registerWith(&eventLoop, sockfd, in_events);
+ try {
+ control_socket_io.addWatch(eventLoop, sockfd, IN_EVENTS);
+ control_socket_open = true;
+ }
+ catch (std::exception &e)
+ {
+ log(LogLevel::ERROR, "Could not setup I/O on control socket: ", e.what());
+ close(sockfd);
+ }