/* Set listen socket's non-blocking flag so we can poll accept() */
on = 1;
if(ioctl(httpsock, FIONBIO, (int)&on) == -1 ) {
printf("error ioctl() fail!\n");
return -1;
}
e = listen(httpsock, 254);
if(e)
{
printf("error %d starting listen on http server\n", e);
return -1;
}