Skip to content

Commit 29369f4

Browse files
committed
CXX-11 platform dependent shutdown and closing of sockets
1 parent f337f2c commit 29369f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mongo/client/scoped_db_conn_test.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,13 @@ namespace mongo {
145145

146146
void close() {
147147
if (!_closed) {
148-
::shutdown(_fd, 2);
148+
#if defined(_WIN32)
149+
::shutdown(_fd, SD_BOTH); // this is SHUT_RDWR on linux and SD_BOTH on windows
149150
::closesocket(_fd);
151+
#else
152+
::shutdown(_fd, SHUT_RDWR);
153+
::close(_fd);
154+
#endif
150155
_closed = true;
151156
_fd = -1;
152157
}

0 commit comments

Comments
 (0)