I submitted the new version code drop as a zip file attachment to AMQ-818 http://issues.apache.org/activemq/browse/AMQ-818
I'm not a committer so it won't get applied until someone who is gets assigned the issue and updates SVN. You can snag the zip file from the issue and build that version, it's a complete code drop (there were a lot of changes). Try that out and let me know how that works for you. If its still not working could you possibly capture what you are doing in a sample app and send it to me, that way I can see how you are using the code and maybe find what the problem is. My test cases all connect and run fine, so you might be uncovering something new. ----------------------------------------- Timothy A. Bish Sensis Corporation ----------------------------------------- > -----Original Message----- > From: kevinba [mailto:[EMAIL PROTECTED] > Sent: Wednesday, July 19, 2006 10:22 AM > To: [email protected] > Subject: RE: Help running CPP Example > > > So did you check in a patch for the disconnect problem. What is > happening? > I notice the exception that causes it to disconnect says something about > "a > connection attempt failed because the connected party did not properly > respond after a period of time, or ..." > > > I have a question. > > the function > > void IOTransport::run(){ > > > Looks like it just loops until the "closed" variable is set. After it but > somewhere in the reader->readCommand it should be blocked until the next > incoming message is recevied correct? > > int SocketInputStream::read( unsigned char* buffer, const int bufferSize ) > throw (IOException){ > > > Finally inside the ::read statement the > > int bytesAvailable = available(); > > > > I'm I following this correctly. > > When you start and do a connection it loops through now and makes the > connection, but it immediatlly loops again even though nothing is > expected. > in the methond IOTransport::run() there is a call for available = > inputStream->available(); This return 1. So it tries to attempt to read > again. > > > When it gets to bytesAvailable = availabe(); it immediately returns with > a > value of 0. > > so then you go into the > > int len = ::recv(socket, (char*)buffer, bufferSize, 0); > > when return timed out because there is nothing waiting on the line. > > But the whole problem steams from the initial CONNECTED message that was > received. You received 72 bytes but when you go through the second loop > in > IOTransport::run() it calls available = inputStream->available(); to see > if > there is anything else pending. it return 1 but not from the > SocketInputStream::available() call that is done. > > The real problem is the (tail-head) are not 0. Tail is 72 and head is > 71. > This is what returns the 1 that tells it there is pending message and > which > causes the timeout because there is nothing there. The original message > is > not processed propperly. > > > > > > -- > View this message in context: http://www.nabble.com/Help-running-CPP- > Example-tf1957518.html#a5397170 > Sent from the ActiveMQ - User forum at Nabble.com.
