activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r547053 - in /activemq/activemq-cpp/trunk/src: main/activemq/network/SocketInputStream.cpp main/activemq/network/SocketOutputStream.cpp test-integration/integration/connector/stomp/StompStressTests.cpp
Date Wed, 13 Jun 2007 22:41:15 GMT
Author: tabish
Date: Wed Jun 13 15:41:14 2007
New Revision: 547053

URL: http://svn.apache.org/viewvc?view=rev&rev=547053
Log:
https://issues.apache.org/activemq/browse/AMQCPP-122

Corrected exception throwing behaviour on the Scoket Streams read and write methods, they
weren't throwning an IOException from these methods when closed.

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/network/SocketInputStream.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/network/SocketOutputStream.cpp
    activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/network/SocketInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/network/SocketInputStream.cpp?view=diff&rev=547053&r1=547052&r2=547053
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/network/SocketInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/network/SocketInputStream.cpp Wed Jun 13
15:41:14 2007
@@ -148,7 +148,7 @@
         len = ::recv(socket, (char*)buffer, (int)bufferSize, 0);
 
         // Check for a closed socket.
-        if( len == 0 && !closed ){
+        if( len == 0 || closed ){
             throw IOException( __FILE__, __LINE__,
                 "activemq::io::SocketInputStream::read - The connection is broken" );
         }
@@ -157,7 +157,7 @@
              SocketError::getErrorCode() == SocketError::INTERRUPTED );
 
     // Check for error.
-    if( len == -1 && !closed ){
+    if( len == -1 ){
 
         // Otherwise, this was a bad error - throw an exception.
         throw IOException( __FILE__, __LINE__,

Modified: activemq/activemq-cpp/trunk/src/main/activemq/network/SocketOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/network/SocketOutputStream.cpp?view=diff&rev=547053&r1=547052&r2=547053
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/network/SocketOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/network/SocketOutputStream.cpp Wed Jun 13
15:41:14 2007
@@ -77,7 +77,7 @@
     while( remaining > 0 && !closed )
     {
         int length = ::send( socket, (const char*)buffer, (int)remaining, sendOpts );
-        if( length == -1 && !closed ){
+        if( length == -1 || closed ){
             throw IOException( __FILE__, __LINE__,
                 "activemq::io::SocketOutputStream::write - %s", SocketError::getErrorString().c_str()
);
         }
@@ -86,4 +86,3 @@
         remaining -= length;
     }
 }
-

Modified: activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp?view=diff&rev=547053&r1=547052&r2=547053
==============================================================================
--- activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test-integration/integration/connector/stomp/StompStressTests.cpp
Wed Jun 13 15:41:14 2007
@@ -78,7 +78,7 @@
         int count = 0;
         activemq::core::ActiveMQConnectionFactory connectionFactory(
             "tcp://localhost:61613?wireFormat=stomp");
-        while( count < 20 ) {
+        while( count < 50 ) {
 
             cms::Connection* connection = connectionFactory.createConnection();
             cms::Session* session = connection->createSession(cms::Session::AUTO_ACKNOWLEDGE);



Mime
View raw message