This pull request removes the possibility of an infinite loop in DHCP_do_boot() and assures both 16-bit and 32-bit versions of the library can timeout of DHCP configuration even if something goes wrong elsewhere in the code. Waiting for a response could take up to 30 seconds so to prevent confusing that with the computer locking up, a dot (.) is printed to the screen every second to indicate to the user that the program is still running and busy.
Tested with:
/* Compile for DOS (Open Watcom) with
* `WCC -0 -bt=dos -i=INC -ml IPCONFIG` then
* `WLINK SYS dos LIBF LIB\WATTCPWL.LIB F IPCONFIG`
*
* Compile for DOS4G (Open Watcom) with
* `WCC386 -3 -bt=dos -i=INC -mf IPCONFIG` then
* `WLINK SYS dos4g LIBF LIB\WATTCPWF.LIB F IPCONFIG`
*/
#include <stdio.h>
#include <tcp.h>
int main() {
struct in_addr addr;
sock_init();
addr.s_addr = htonl(my_ip_addr);
printf("Address: %s\n", inet_ntoa(addr));
return 0;
}
Addresses part of #4
This pull request removes the possibility of an infinite loop in
DHCP_do_boot()
and assures both 16-bit and 32-bit versions of the library can timeout of DHCP configuration even if something goes wrong elsewhere in the code. Waiting for a response could take up to 30 seconds so to prevent confusing that with the computer locking up, a dot (.
) is printed to the screen every second to indicate to the user that the program is still running and busy.Tested with: