Win32 app / optional port (#609)

* Ignore libs_for_simulator content

* Accept command line optional port

* Fixed order of buttons

* Adjusted argv parsing

* Changed output assembly to openBeken_win32

* Automatically load the last project
This commit is contained in:
Indu Prakash
2023-01-22 12:25:50 -06:00
committed by GitHub
parent 7bb7667792
commit 28af05268d
7 changed files with 47 additions and 5 deletions

View File

@ -10,7 +10,7 @@
SOCKET ListenSocket = INVALID_SOCKET;
#define DEFAULT_PORT "80"
int g_port = 80;
int HTTPServer_Start() {
@ -29,7 +29,10 @@ int HTTPServer_Start() {
closesocket(ListenSocket);
}
// Resolve the server address and port
iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
char service[6];
snprintf(service, sizeof(service), "%u", g_port);
iResult = getaddrinfo(NULL, service, &hints, &result);
if ( iResult != 0 ) {
printf("getaddrinfo failed with error: %d\n", iResult);
WSACleanup();