MUX: Added delay after closing a socket created to validate a port specification. Suggested by Mark Emmer

The network stack on Windows XP needs an opportunity to cleanup after closing a listening socket which was created but not used,
This commit is contained in:
Mark Pizzolato 2014-02-23 08:54:00 -08:00
parent 02cb5c2d88
commit 44f66e90eb

View file

@ -2222,12 +2222,13 @@ while (*tptr) {
cptr = init_cptr; cptr = init_cptr;
} }
cptr = get_glyph_nc (cptr, port, ';'); cptr = get_glyph_nc (cptr, port, ';');
sock = sim_master_sock (port, &r); /* make master socket */ sock = sim_master_sock (port, &r); /* make master socket to validate port */
if (r != SCPE_OK) if (r != SCPE_OK)
return r; return r;
if (sock == INVALID_SOCKET) /* open error */ if (sock == INVALID_SOCKET) /* open error */
return SCPE_OPENERR; return SCPE_OPENERR;
sim_close_sock (sock, 1); sim_close_sock (sock, 1);
sim_os_ms_sleep (2); /* let the close finish (required on some platforms) */
strcpy(listen, port); strcpy(listen, port);
cptr = get_glyph (cptr, option, ';'); cptr = get_glyph (cptr, option, ';');
if (option[0]) { if (option[0]) {