Skip to content

TCP connection reconnects every 60s #6

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

Open
betzrhodes opened this issue May 8, 2017 · 3 comments
Open

TCP connection reconnects every 60s #6

betzrhodes opened this issue May 8, 2017 · 3 comments
Assignees

Comments

@betzrhodes
Copy link
Contributor

Whenever I open a connection it seems to disconnect and reconnect every 60s.

Logs from code running with only an onConnect handler:
2017-05-08 15:07:24 -07:00 [Status] Downloading new code; 27.09% program storage used
2017-05-08 15:07:31 -07:00 [Device] Index : 0, value : 0
2017-05-08 15:07:31 -07:00 [Device] Index : 1, value : 0
2017-05-08 15:08:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:08:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:09:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:09:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:10:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:10:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:11:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:11:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:12:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:12:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:13:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:13:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:14:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:14:31 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:15:31 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:15:31 -07:00 [Device] Index : 1, value : 88

Logs from code running with onConnect and onReconnect handlers:
2017-05-08 15:15:43 -07:00 [Status] Downloading new code; 27.15% program storage used
2017-05-08 15:15:43 -07:00 [Status] Agent restarted: reload.
2017-05-08 15:15:52 -07:00 [Device] Index : 0, value : 28
2017-05-08 15:15:52 -07:00 [Device] Index : 1, value : 88
2017-05-08 15:16:52 -07:00 [Device] (instance : 0x534050)
2017-05-08 15:17:52 -07:00 [Device] (instance : 0x53c540)
2017-05-08 15:18:52 -07:00 [Device] (instance : 0x54a428)
2017-05-08 15:19:52 -07:00 [Device] (instance : 0x54a1c8)
2017-05-08 15:20:52 -07:00 [Device] (instance : 0x54d138)
2017-05-08 15:21:52 -07:00 [Device] (instance : 0x5362d8)
2017-05-08 15:22:52 -07:00 [Device] (instance : 0x5363c0)
2017-05-08 15:23:52 -07:00 [Device] (instance : 0x538828)
2017-05-08 15:24:52 -07:00 [Device] (instance : 0x53db20)
2017-05-08 15:25:52 -07:00 [Device] (instance : 0x535fc8)
2017-05-08 15:26:52 -07:00 [Device] (instance : 0x5472c8)
2017-05-08 15:27:52 -07:00 [Device] (instance : 0x535b30)
2017-05-08 15:28:52 -07:00 [Device] (instance : 0x535bc8)

@DerrickHoPakCheung
Copy link
Collaborator

the disconnection and reconnection are caused by the inactivity of the master after a certain amount of idle time. If the connection is busy, the connection stays open. With some PLCs, the connection timeout can be configured. Regardless, would you like to have an optional keepAlive function to keep the connection open ?

@betzrhodes
Copy link
Contributor Author

Can this behavior be added to the documentation. This will help the user know what functions they need to pass in.

@DerrickHoPakCheung
Copy link
Collaborator

sure no problem

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