Skip to content

Commit 0ed5e08

Browse files
fix(TcpSource): do not close socket on inactivity
Remove timeout that closes the socket of TcpSource after a 2s inactivity. This will allow us to have the stream open even though no events are published from the device. Refs #400
1 parent 660de40 commit 0ed5e08

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/components/tcp/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ export class TcpSource extends Source {
5252
socket.destroy()
5353
incoming.push(null)
5454
})
55-
socket.setTimeout(2000, () => {
56-
console.error(`Timeout when connecting to ${hostname}:${port}`)
57-
socket.destroy()
58-
incoming.push(null)
59-
})
6055

6156
socket.on('data', (buffer) => {
6257
if (!incoming.push({ data: buffer, type: MessageType.RAW })) {

0 commit comments

Comments
 (0)