Skip navigation
703 Views 3 Replies Latest reply: Dec 17, 2013 3:04 AM by Flow RSS
Currently Being Moderated

Aug 22, 2011 6:42 AM

IBBInputStream does not behave appropriately (auto-closing?)

Hello,

 

I just updated from Smack 3.1 to 3.2.1 and now encounter a problem with IBBInputStream.

I am reading data from the stream in a simple loop like this

while ((len = stream.read(buf)) > 0){ ... }

 

This has worked fine before (and should IMO) but now an IOException is thrown saying

Stream is closed

at org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamSession$IBBInputStream. checkClosed(InBandBytestreamSession.java:395)

at org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamSession$IBBInputStream. read(InBandBytestreamSession.java:279)

 

Appearantly, the underlying stream has been closed by a different thread. (The debug output shows a respective IP:Close message.)

 

This should be handled in a more graceful way. - Especially, as there might be remaining buffered data which has not been read!

 

Cheers,

Sebastian

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points