mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/MessageDualListener.java
public void waitForMessagesTwoSockets(int timeoutMS)
    {       
        m_Responses.clear();
        m_AdditionalResponses.clear();
        AdditionalMessageThread additionalMessageThread = new AdditionalMessageThread();
        try
        {
            Thread messageThread = new Thread(additionalMessageThread);
            messageThread.start();
            Thread.sleep(timeoutMS);
            additionalMessageThread.stop();
            messageThread.join(SOCK_TIMEOUT+200); //give time for message thread to finish stopping
            assertThat(messageThread.isAlive(), is(false));
        }
        catch (InterruptedException e)
        {
            fail("Thread was interrupted while waiting for messages...\n" + e.getMessage());
        }
    }
/**
     * Method starts message listening thread for two sockets that must be specified in the constructor of this
     * listener instance, and stops the thread after a specific amount of time. 
     * @param timeoutMS
     *      Maximum amount of time to wait (in milliseconds) for the listening threads to finish listening 
     *      for incoming messages.  The listening threads will be terminated in the event that execution
     *      cannot be completed in the allotted time.  
     */
Method starts message listening thread for two sockets that must be specified in the constructor of this
listener instance, and stops the thread after a specific amount of time.
@param timeoutMS
Maximum amount of time to wait (in milliseconds) for the listening threads to finish listening
for incoming messages.  The listening threads will be terminated in the event that execution
cannot be completed in the allotted time.
Method starts message listening thread for two sockets that must be specified in the constructor of this listener instance and stops the thread after a specific amount of time . @param timeoutMS Maximum amount of time to wait ( in milliseconds ) for the listening threads to finish listening for incoming messages . The listening threads will be terminated in the event that execution cannot be completed in the allotted time .
public void waitForMessagesTwoSockets(int timeoutMS)
    {       
        m_Responses.clear();
        m_AdditionalResponses.clear();
        AdditionalMessageThread additionalMessageThread = new AdditionalMessageThread();
        try
        {
            Thread messageThread = new Thread(additionalMessageThread);
            messageThread.start();
            Thread.sleep(timeoutMS);
            additionalMessageThread.stop();
            messageThread.join(SOCK_TIMEOUT+200); 
            assertThat(messageThread.isAlive(), is(false));
        }
        catch (InterruptedException e)
        {
            fail("Thread was interrupted while waiting for messages...\n" + e.getMessage());
        }
    }
public void waitForMessagesTwoSockets ( int timeoutMS ) { m_Responses . clear ( ) ; m_AdditionalResponses . clear ( ) ; AdditionalMessageThread additionalMessageThread = new AdditionalMessageThread ( ) ; try { Thread messageThread = new Thread ( additionalMessageThread ) ; messageThread . start ( ) ; Thread . sleep ( timeoutMS ) ; additionalMessageThread . stop ( ) ; messageThread . join ( SOCK_TIMEOUT + 200 ) ; assertThat ( messageThread . isAlive ( ) , is ( false ) ) ; } catch ( InterruptedException e ) { fail ( "Thread was interrupted while waiting for messages...\n" + e . getMessage ( ) ) ; } }
Method starts message listening thread for two sockets that must be specified in the constructor of this
 listener instance, and stops the thread after a specific amount of time.
Method starts message listening thread for two sockets that must be specified in the constructor of this listener instance and stops the thread after a specific amount of time .
//give time for message thread to finish stopping