Re: [Quickfix-developers] Too many open files
Brought to you by:
orenmnero
From: Rainer S. <ra...@aa...> - 2002-06-07 13:44:46
|
Ok, found the problem. SocketConnector::connect seems to be missing a close() in the error case. int SocketConnector::connect( const std::string& address, int port ) { int sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); sockaddr_in addr; addr.sin_family = PF_INET; addr.sin_port = htons(port); addr.sin_addr.s_addr = inet_addr(socket_hostname(address.c_str())); int result = ::connect(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)); if(result == 0) { m_monitor.add(sock); return sock; } else { // Added by rainer. close(sock); return 0; } } There is another problem with this code, in that if one has more than one FIX session specified in the config file and one of the servers is unreachable, the whole process (all FIX sessions) will hang on each reconnect attempt - not good! Only solution is to put the socket in non-blocking mode and handle the connect asynchronously. Since I need multiple FIX connections, I might have a go at it... Rainer > On Friday, June 7, 2002, at 02:59 PM, Rainer Staringer wrote: > > Hi, > > I am developing a FIX client based on quickfix. > > I noticed that quickfix (Linux kernel version 2.4.16), when left > running long enough, uses up all available file descriptors for the > process, even when only heartbeat messages are exchanged. > > Anybody else encountered this problem? Known patch/workaround? > > Thanks, > > Rainer > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |