[Quickfix-developers] SocketAcceptor listens on all local interfaces, should be configurable
Brought to you by:
orenmnero
From: Joerg T. <Joe...@ma...> - 2003-04-03 08:10:11
|
Hi, looking at documentation for the configuration of the Acceptor, I see that only the listen port can be configured. The source reveals that the SocketAcceptor listens on all local interfaces (line 116): 108 SocketServer::SocketServer( int port, int timeout ) 109 : m_port( port ), m_monitor( timeout ) 110 { 111 m_socket = socket( PF_INET, SOCK_STREAM, 0 ); 112 if ( m_socket < 0 ) throw std::exception(); 113 114 m_address.sin_family = PF_INET; 115 m_address.sin_port = htons( port ); 116 m_address.sin_addr.s_addr = INADDR_ANY; 117 m_socklen = sizeof( m_address ); 118 119 socket_setsockopt( m_socket ); 120 if ( !bind() ) throw std::exception(); 121 if ( !listen() ) throw std::exception(); 122 m_monitor.add( m_socket ); 123 } The backlog is currently configured to the maximum value. This could be also configurable. Since we work with virtual interface in the production environment, it would be important if we could specify a distinct host/IP address to listen on. The default could remain e.g. "*" which could mean INADDR_ANY. Oren, shall I provide a patch to implement this? Cheers, Jörg -- Joerg Thoennes http://macd.com Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen |