powered by Jive Software

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

1 Like

Hello,

agree with that error, causes strange and unexpected bugs.

greetings

Stefan

More than 2 years old, and still unresolved…

I just lost a couple of hours debugging on the server, then on a local machine, with different versions of client and server, just to discover that simply the impl is broken…

Logged as SMACK-468