aboutsummaryrefslogtreecommitdiff
path: root/works/life
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-28 13:58:07 +0800
committercrupest <crupest@outlook.com>2021-05-28 13:58:07 +0800
commitbaada7b0b03a0fd3bab6ccf996515c7dd7bd71af (patch)
tree3620102896cdeaa38d8dedad4502d17389c930b2 /works/life
parent845cbd79a68ed1a601e6b8eea4268a037dc3468b (diff)
downloadcrupest-baada7b0b03a0fd3bab6ccf996515c7dd7bd71af.tar.gz
crupest-baada7b0b03a0fd3bab6ccf996515c7dd7bd71af.tar.bz2
crupest-baada7b0b03a0fd3bab6ccf996515c7dd7bd71af.zip
import(life): computer-network-experiment: Fix server not close socket.
Diffstat (limited to 'works/life')
-rw-r--r--works/life/computer-network-experiment/server.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/works/life/computer-network-experiment/server.cpp b/works/life/computer-network-experiment/server.cpp
index 1b196a9..15470f4 100644
--- a/works/life/computer-network-experiment/server.cpp
+++ b/works/life/computer-network-experiment/server.cpp
@@ -82,6 +82,8 @@ void ResponseThreadProc(int socket, sockaddr_in address) {
std::lock_guard<std::mutex> guard(cout_mutex);
std::cout << "Succeeded to send message to " << address_string << "!\n";
}
+
+ closesocket(socket);
}
int main() {