mirror of
https://github.com/wiiu-env/wiiload_plugin.git
synced 2024-11-29 05:54:14 +01:00
Add missing shutdown/close
This commit is contained in:
parent
3cf879dee7
commit
37d42d27ad
@ -39,6 +39,8 @@ TcpReceiver::~TcpReceiver() {
|
|||||||
|
|
||||||
if (serverSocket >= 0) {
|
if (serverSocket >= 0) {
|
||||||
shutdown(serverSocket, SHUT_RDWR);
|
shutdown(serverSocket, SHUT_RDWR);
|
||||||
|
close(serverSocket);
|
||||||
|
serverSocket = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,12 +64,16 @@ void TcpReceiver::executeThread() {
|
|||||||
socklen_t len;
|
socklen_t len;
|
||||||
int32_t ret;
|
int32_t ret;
|
||||||
if ((ret = bind(serverSocket, (struct sockaddr *) &bindAddress, 16)) < 0) {
|
if ((ret = bind(serverSocket, (struct sockaddr *) &bindAddress, 16)) < 0) {
|
||||||
|
shutdown(serverSocket, SHUT_RDWR);
|
||||||
close(serverSocket);
|
close(serverSocket);
|
||||||
|
serverSocket = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = listen(serverSocket, 1)) < 0) {
|
if ((ret = listen(serverSocket, 1)) < 0) {
|
||||||
|
shutdown(serverSocket, SHUT_RDWR);
|
||||||
close(serverSocket);
|
close(serverSocket);
|
||||||
|
serverSocket = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +100,9 @@ void TcpReceiver::executeThread() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shutdown(serverSocket, SHUT_RDWR);
|
||||||
close(serverSocket);
|
close(serverSocket);
|
||||||
|
serverSocket = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TcpReceiver::loadToMemory(int32_t clientSocket, uint32_t ipAddress) {
|
int32_t TcpReceiver::loadToMemory(int32_t clientSocket, uint32_t ipAddress) {
|
||||||
|
Loading…
Reference in New Issue
Block a user