Re: [Quickfix-developers] file descriptor/memory leakin ThreadedSocketInitiator
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2007-01-08 16:47:12
|
Good call. Would you be able to do an overnight test with this to
verify the problem goes away?
--oren
On Jan 8, 2007, at 10:39 AM, Alex Shterenberg wrote:
> Oren,
>
> I looked at the latest code in the repository and revision 1725 and
> found that the problem still exists.
>
> The fix you are referring to tries (I think) to address socket cleanup
> inside of ThreadedSocketConnection.
>
> The problem occurs prior to the creation of the
> ThreadedSocketConnection
> instance, when doConnect returns without cleaning up the socket. I
> fixed
> it by inserting "socket_close( socket );":
>
> int socket = socket_createConnector();
>
> if( socket_connect(socket, address.c_str(), port) < 0 )
> {
> log->onEvent( "Connection failed" );
> socket_close( socket );
> return false;
> }
>
> log->onEvent( "Connection succeeded" );
>
> ThreadedSocketConnection* pConnection =
> new ThreadedSocketConnection( s, socket, getApplication(), *this
> );
>
> Alex
|