Skip to content

Commit

Permalink
ThreadedSocketConnection does not need a reference to an application.
Browse files Browse the repository at this point in the history
Kill all running instances of ut and at before running tests.
  • Loading branch information
Oren Miller committed Mar 22, 2014
1 parent d42d13e commit ebc0f9d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/C++/ThreadedSocketAcceptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ THREAD_PROC ThreadedSocketAcceptor::socketAcceptorThread( void* p )

ThreadedSocketConnection * pConnection =
new ThreadedSocketConnection
( socket, sessions, pAcceptor->getApplication(), pAcceptor->getLog() );
( socket, sessions, pAcceptor->getLog() );

ConnectionThreadInfo* info = new ConnectionThreadInfo( pAcceptor, pConnection );

Expand Down
8 changes: 4 additions & 4 deletions src/C++/ThreadedSocketConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
namespace FIX
{
ThreadedSocketConnection::ThreadedSocketConnection
( int s, Sessions sessions, Application& application, Log* pLog )
: m_socket( s ), m_application( application ), m_pLog( pLog ),
( int s, Sessions sessions, Log* pLog )
: m_socket( s ), m_pLog( pLog ),
m_sessions( sessions ), m_pSession( 0 ),
m_disconnect( false )
{
Expand All @@ -44,9 +44,9 @@ ThreadedSocketConnection::ThreadedSocketConnection
ThreadedSocketConnection::ThreadedSocketConnection
( const SessionID& sessionID, int s,
const std::string& address, short port,
Application& application, Log* pLog )
Log* pLog )
: m_socket( s ), m_address( address ), m_port( port ),
m_application( application ), m_pLog( pLog ),
m_pLog( pLog ),
m_pSession( Session::lookupSession( sessionID ) ),
m_disconnect( false )
{
Expand Down
5 changes: 2 additions & 3 deletions src/C++/ThreadedSocketConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class ThreadedSocketConnection : Responder
public:
typedef std::set<SessionID> Sessions;

ThreadedSocketConnection( int s, Sessions sessions, Application& application, Log* pLog );
ThreadedSocketConnection( int s, Sessions sessions, Log* pLog );
ThreadedSocketConnection( const SessionID&, int s,
const std::string& address, short port,
Application&, Log* pLog );
Log* pLog );
virtual ~ThreadedSocketConnection() ;

Session* getSession() const { return m_pSession; }
Expand All @@ -70,7 +70,6 @@ class ThreadedSocketConnection : Responder
std::string m_address;
int m_port;

Application& m_application;
Log* m_pLog;
Parser m_parser;
Sessions m_sessions;
Expand Down
2 changes: 1 addition & 1 deletion src/C++/ThreadedSocketInitiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void ThreadedSocketInitiator::doConnect( const SessionID& s, const Dictionary& d
log->onEvent( "Connecting to " + address + " on port " + IntConvertor::convert((unsigned short)port) );

ThreadedSocketConnection* pConnection =
new ThreadedSocketConnection( s, socket, address, port, getApplication(), getLog() );
new ThreadedSocketConnection( s, socket, address, port, getLog() );

ThreadPair* pair = new ThreadPair( this, pConnection );

Expand Down
2 changes: 2 additions & 0 deletions test/runat.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

killall ut at

RUBY="ruby -I."
DIR=`pwd`
PORT=$1
Expand Down
2 changes: 2 additions & 0 deletions test/runat_threaded.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

killall ut at

DIR=`pwd`
PORT=$1
./setup.sh $PORT
Expand Down
2 changes: 2 additions & 0 deletions test/runut.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

killall ut at

DIR=`pwd`

./ut -p $1 -f cfg/ut.cfg
Expand Down

0 comments on commit ebc0f9d

Please sign in to comment.