-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when creating context with occupied port #14
Comments
Forgot to mention: |
On 21/10/13 23:07, the mail apparently from fuzzy included:
It's a Windows quirk unlike normal unixish OSes socket handles are not -Andy
|
Great, thank you much! |
libwebsocket_create_context(...) crashes on a line 2163 of libwebsockets.c while trying to create a context for a port that is taken by the other instance of libwebsockets (i.e. an instance of websocket server with a port 9000 is running in a separate process and I'm trying to create a new websocket server on the very same port)
if (n < 0) {
lwsl_err("ERROR on binding to port %d (%d %d)\n",
info->port, n, errno);
close(sockfd); // this line leads to the crash
goto bail;
}
commenting out the "close(sockfd);" line seems to solve the issue so libwebsocket_create_context is able to return NULL if a particular port is taken, but I don't think it's a proper way to solve this.
The text was updated successfully, but these errors were encountered: