[Quickfix-users] SocketConnection::read( SocketConnector& s ) doesn't catch RecvFailed exception
Brought to you by:
orenmnero
|
From: Brendan B. B. <br...@ka...> - 2003-07-11 18:19:28
|
Resending as I didn't see this in the archives so I don't know if it
made it out...
Regards,
Brendan
-----Original Message-----
From: qui...@li...
[mailto:qui...@li...]On Behalf Of Brendan
B. Boerner
Sent: Wednesday, July 09, 2003 8:09 AM
To: Quickfix-Users
Subject: [Quickfix-users] SocketConnection::read( SocketConnector& s )
doesn't catch RecvFailed exception
Hello,
bool SocketConnection::readMessage( std::string& msg ) calls
m_parser.readFixMessage( msg ); which calls Parser::readFromStream()
which can throw a RecvFailed exception.
Callers of SocketConnection::readMessage(...) are:
bool SocketConnection::read( SocketAcceptor& a, SocketServer& s )
bool SocketConnection::read( SocketConnector& s )
void ThreadedSocketConnection::processStream()
Only SocketConnection::read( SocketAcceptor& a, SocketServer& s )
catches the exception:
catch ( RecvFailed& )
{
s.getMonitor().drop( m_socket );
}
Shouldn't SocketConnection::read( SocketConnector& s ) (and
ThreadedSocketConnection::processStream(), I haven't used it) do
something similar e.g.
bool SocketConnection::read( SocketConnector& s )
{ QF_STACK_PUSH(SocketConnection::read)
#if 1
// brendan 7/9/03
if ( !m_pSession ) return false;
std::string msg;
try
{
if ( !readMessage( msg ) ) return false;
m_pSession->next( msg );
}
catch ( InvalidMessage& )
{
return false;
}
catch ( RecvFailed& )
{
if ( !m_pSession->isLoggedOn() )
s.getMonitor().drop( m_socket );
return false;
}
return true;
#else
// orig
if ( !m_pSession ) return false;
std::string msg;
if ( !readMessage( msg ) ) return false;
try
{
m_pSession->next( msg );
}
catch ( InvalidMessage& ) {}
return true;
#endif // #if 1
QF_STACK_POP
}
?
I don't think this is a complete fix - when I've been able to cause
the exception to be thrown and then let it go VC++ then proceeds to
take 50-90% CPU. The only way I've been able to get out of that
state is to terminate the MSDEV.EXE process using TaskMan.
Regards,
Brendan
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
Quickfix-users mailing list
Qui...@li...
https://lists.sourceforge.net/lists/listinfo/quickfix-users
|