From a680a6e5fe18a0309b8477f75e5184ceeb5eb83d Mon Sep 17 00:00:00 2001 From: ehouse Date: Mon, 6 Jul 2009 01:32:30 +0000 Subject: [PATCH] Always close sockets we're done with. Otherwise they leak -- don't get reused. --- xwords4/relay/tpool.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xwords4/relay/tpool.cpp b/xwords4/relay/tpool.cpp index aad720cae..0a93219e0 100644 --- a/xwords4/relay/tpool.cpp +++ b/xwords4/relay/tpool.cpp @@ -64,6 +64,8 @@ XWThreadPool::XWThreadPool() } m_pipeRead = fd[0]; m_pipeWrite = fd[1]; + logf( XW_LOGINFO, "pipes: m_pipeRead: %d; m_pipeWrite: %d", + m_pipeRead, m_pipeWrite ); } XWThreadPool::~XWThreadPool() @@ -153,7 +155,8 @@ XWThreadPool::CloseSocket( int socket ) ++iter; } } -/* close( socket ); */ + logf( XW_LOGINFO, "CLOSING socket %d", socket ); + close( socket ); /* if ( do_interrupt ) { */ /* We always need to interrupt the poll because the socket we're closing will be in the list being listened to. That or we need to drop sockets