0
0
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:
Eliot Horowitz 2010-02-07 15:41:52 -05:00
parent d1c3f1a9eb
commit ddd617b35a
2 changed files with 2 additions and 2 deletions

View File

@ -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 ) {

View File

@ -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 ) {