Update the return values of socket.listen, also return the real port bind to zero (#1638)

This commit is contained in:
zaxbbun
2022-09-03 07:19:03 +08:00
committed by GitHub
parent 6bd6f53ab8
commit c1eeba215d
10 changed files with 30 additions and 18 deletions

View File

@@ -331,7 +331,7 @@ start_listen(struct gate *g, char * listen_addr) {
portstr[0] = '\0';
host = listen_addr;
}
g->listen_id = skynet_socket_listen(ctx, host, port, BACKLOG);
g->listen_id = skynet_socket_listen(ctx, host, &port, BACKLOG);
if (g->listen_id < 0) {
return 1;
}