garrows / browser-serialport

Robots in the browser. Just like node-serialport but for browser/chrome apps.
MIT License
205 stars 73 forks source link

Close connection during specific onReceiveError cases, fixes connectionId leak #38

Closed 2fast2fourier closed 9 years ago

2fast2fourier commented 9 years ago

According to Chrome's serial documentation, when onReceiveError is called the connection is only paused but not automatically closed. This fixes an edge case where the connectionId was being reset but the underlying connection was never closed, leading to a connection leak.