+ hsrv = start (config);
+ if (hsrv == NULL)
+ exit(1);
+
+ if (config->readyfd != 0) {
+ static const char readystr[] = "READY=1";
+ write(config->readyfd, readystr, sizeof(readystr) - 1);
+ close(config->readyfd);
+ }
+
+ // infinite loop
+ for(;;)
+ upoll_wait(30000);
+
+ if (verbosity)
+ fprintf (stderr, "hoops returned from infinite loop [report bug]\n");
+
+ return 0;
+}
+
+static int init(struct afb_hsrv *hsrv, struct afb_config * config)
+{
+ int idx;
+
+ if (!afb_hsrv_add_handler(hsrv, config->rootapi, afb_hswitch_websocket_switch, NULL, 20))
+ return 0;