From fcd2304e04dd3fabdefce4293b1b76ad99f8ed73 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 6 Jun 2021 22:13:43 +0800 Subject: import(life): ... --- works/life/computer-network-experiment/server.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'works/life/computer-network-experiment/server.cpp') diff --git a/works/life/computer-network-experiment/server.cpp b/works/life/computer-network-experiment/server.cpp index 297114b..9cf655a 100644 --- a/works/life/computer-network-experiment/server.cpp +++ b/works/life/computer-network-experiment/server.cpp @@ -2,15 +2,17 @@ * This is the server program. */ +#include "Common.h" #include "Output.h" -#include -#include #include -#include -#include #include +#ifdef WIN32 +#include +#include +#endif + const auto bind_address = "127.0.0.1"; // control bind address const u_short port = 1234; // control bind port @@ -48,11 +50,7 @@ void ResponseThreadProc(int socket, sockaddr_in address) { closesocket(socket); } -int main() { -#ifdef WIN32 - InitWSA(); -#endif - +int Main() { int server_socket; if ((server_socket = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { -- cgit v1.2.3