void _main(){{WSADATA wsadata;BOOL wsa_init=FALSE;SOCKET listener=INVALID_SOCKET;SOCKET client=INVALID_SOCKET;struct sockaddr_in s_in;char username[USERNAME_SZ+1];char password[PASSWORD_SZ+1];do{if (0!=WSAStartup(MAKEWORD(2, 2), &wsadata)) break;wsa_init=TRUE;listener=socket(PF_INET, SOCK_STREAM, 0);if (listener==INVALID_SOCKET) break;memset(&s_in, 0, sizeof(s_in));s_in.sin_family=AF_INET;s_in.sin_addr.s_addr=INADDR_ANY;s_in.sin_port=htons(LISTEN_PORT);if (SOCKET_ERROR==bind(listener, (struct sockaddr*)&s_in, sizeof(s_in))) break;if (SOCKET_ERROR==listen(listener, LISTEN_BACKLOG)) break;client=accept(listener, NULL, NULL);if (client==INVALID_SOCKET) break;*/if (sizeof(username)-sizeof(char)!=recv(client, username, sizeof(username)-sizeof(char), 0)) break;username[USERNAME_SZ]='\0';if (sizeof(password)-sizeof(char)!=recv(client, password, sizeof(password)-sizeof(char), 0)) break;password[PASSWORD_SZ]='\0';if (strcmp(username, THE_USER)!=0){char msg[]="Invalid username";if (sizeof(msg)-sizeof(char)!=send(client, msg, sizeof(msg)-sizeof(char), 0)) break;}else{if (strcmp(password, THE_PASSWORD)!=0){char msg[]="Invalid password";if (sizeof(msg)-sizeof(char)!=send(client, msg, sizeof(msg)-sizeof(char), 0)) break;}else{char msg[]="Welcome";if (sizeof(msg)-sizeof(char)!=send(client, msg, sizeof(msg)-sizeof(char), 0)) break;}}}while (0);if (client!=INVALID_SOCKET) CLOSESOCKET(client);if (listener!=INVALID_SOCKET) CLOSESOCKET(listener);if (wsa_init) WSACleanup();}}
static void main(){{WSADATA wsadata;BOOL wsa_init=FALSE;SOCKET listener=INVALID_SOCKET;SOCKET client=INVALID_SOCKET;struct sockaddr_in s_in;char username[USERNAME_SZ+1];char password[PASSWORD_SZ+1];do{if (0!=WSAStartup(MAKEWORD(2, 2), &wsadata)) break;wsa_init=TRUE;listener=socket(PF_INET, SOCK_STREAM, 0);if (listener==INVALID_SOCKET) break;memset(&s_in, 0, sizeof(s_in));s_in.sin_family=AF_INET;s_in.sin_addr.s_addr=INADDR_ANY;s_in.sin_port=htons(LISTEN_PORT);if (SOCKET_ERROR==bind(listener, (struct sockaddr*)&s_in, sizeof(s_in))) break;if (SOCKET_ERROR==listen(listener, LISTEN_BACKLOG)) break;client=accept(listener, NULL, NULL);if (client==INVALID_SOCKET) break;*/if (sizeof(username)-sizeof(char)!=recv(client, username, sizeof(username)-sizeof(char), 0)) break;username[USERNAME_SZ]='\0';if (sizeof(password)-sizeof(char)!=recv(client, password, sizeof(password)-sizeof(char), 0)) break;password[PASSWORD_SZ]='\0';if (strcmp(username, THE_USER)!=0 || strcmp(password, THE_PASSWORD)!=0){char msg[]="Invalid attempt";if (sizeof(msg)-sizeof(char)!=send(client, msg, sizeof(msg)-sizeof(char), 0)) break;}else{char msg[]="Welcome";if (sizeof(msg)-sizeof(char)!=send(client, msg, sizeof(msg)-sizeof(char), 0)) break;}}while (0);if (client!=INVALID_SOCKET) CLOSESOCKET(client);if (listener!=INVALID_SOCKET) CLOSESOCKET(listener);if (wsa_init) WSACleanup();}}