mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
don't try and accept sockets after socket is closed
This commit is contained in:
parent
d1c3f1a9eb
commit
ddd617b35a
@ -72,7 +72,7 @@ namespace mongo {
|
||||
void Listener::listen() {
|
||||
static long connNumber = 0;
|
||||
SockAddr from;
|
||||
while ( 1 ) {
|
||||
while ( ! inShutdown() ) {
|
||||
int s = accept(sock, (sockaddr *) &from.sa, &from.addressSize);
|
||||
if ( s < 0 ) {
|
||||
if ( errno == ECONNABORTED || errno == EBADF ) {
|
||||
|
@ -203,7 +203,7 @@ namespace mongo {
|
||||
|
||||
void MiniWebServer::run() {
|
||||
SockAddr from;
|
||||
while ( 1 ) {
|
||||
while ( ! inShutdown() ) {
|
||||
int s = accept(sock, (sockaddr *) &from.sa, &from.addressSize);
|
||||
if ( s < 0 ) {
|
||||
if ( errno == ECONNABORTED ) {
|
||||
|
Loading…
Reference in New Issue
Block a user