+ if(listen_socket[listen_sockets].udp < 0) {
+ close(listen_socket[listen_sockets].tcp);
+ continue;
+ }
+
+ event_set(&listen_socket[listen_sockets].ev_tcp,
+ listen_socket[listen_sockets].tcp,
+ EV_READ|EV_PERSIST,
+ handle_new_meta_connection, NULL);
+ if(event_add(&listen_socket[listen_sockets].ev_tcp, NULL) < 0) {
+ logger(LOG_WARNING, _("event_add failed: %s"), strerror(errno));
+ close(listen_socket[listen_sockets].tcp);
+ close(listen_socket[listen_sockets].udp);
+ continue;
+ }
+
+ event_set(&listen_socket[listen_sockets].ev_udp,
+ listen_socket[listen_sockets].udp,
+ EV_READ|EV_PERSIST,
+ handle_incoming_vpn_data, NULL);
+ if(event_add(&listen_socket[listen_sockets].ev_udp, NULL) < 0) {
+ logger(LOG_WARNING, _("event_add failed: %s"), strerror(errno));
+ close(listen_socket[listen_sockets].tcp);
+ close(listen_socket[listen_sockets].udp);
+ event_del(&listen_socket[listen_sockets].ev_tcp);