Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BACnet reader hangs #11

Open
tsnouidui opened this issue Apr 15, 2016 · 0 comments
Open

BACnet reader hangs #11

tsnouidui opened this issue Apr 15, 2016 · 0 comments
Assignees

Comments

@tsnouidui
Copy link
Member

Original reporter: mwetter

The BACnet reader hangs. The user error report is:

My computer runs on Windows XP 32bits and I my firewall is off.

I traced throught the code to find where it was hanging. It's hanging in BACnetDeviceManager class in findDevice() method.
The buffered reader that reads the output from the ProcessBuilder was never in a ready state. I did some research about that
and found that webpage:
http://stackoverflow.com/questions/3159913/problem-reading-inputstream-from-java-process-runtime-getruntime-exec-or-pro

Apparently it's the error stream in the processbuilder that was hanging the program so I added the following:
pb.redirectErrorStream(true);

so the error stream is redirected in the output stream and the program didn't hang any more.

After that, I had some problems reading the stream. 2 device names were alphanumeric and didn't start with "Received":
Recei30000 and
ved I-Am Request from 303013...

It's weird that the 30000 goes and mix the "Received I-Am Request from 303013". Maybe some kind of synchronization problem.
My solution was to remove the throw new IllegalActionException in the catch NumberFormatException so it continues to read all the
device names even if some of them have errors.

With those 2 corrections, everything works correctly on my computer. But that doesn't explain why it works correctly on your computer.
It would be nice if you could send me BACnetDeviceManager.java from your BCVTB folder so I could compare what's different.
I'm using Java jdk1.6.0_20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants