Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

me.legrange.swap.tcp.TcpTransport.Reader.run should detect socket disconnects better #21

@MBradbury

Description

@MBradbury

While having the panstamp-tools gui attached to the debug port of my OpenHab instance with the panstamp binding running, if I kill the gui tool without cleanly disconnecting then OpenHab goes into an infinite loop logging the following error message:

2016-05-02 08:30:18.159 [ERROR] [legrange.swap.tcp.TcpTransport] - null
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:154) ~[na:1.8.0_65]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_65]
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) ~[na:1.8.0_65]
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_65]
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) ~[na:1.8.0_65]
at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.8.0_65]
at java.io.BufferedReader.fill(BufferedReader.java:161) ~[na:1.8.0_65]
at java.io.BufferedReader.readLine(BufferedReader.java:324) ~[na:1.8.0_65]
at java.io.BufferedReader.readLine(BufferedReader.java:389) ~[na:1.8.0_65]
at me.legrange.swap.tcp.TcpTransport$Reader.run(TcpTransport.java:192) ~[na:na]

me.legrange.swap.tcp.TcpTransport.Reader.run should detect that the socket has been forcibly closed from other other end, log a message once and then stop looping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions