Skip to content

Fix if there's a new connection of and exisiting device id, it will remove the exisiting device and the new one #438

@diogoViana95

Description

@diogoViana95

If you have one device connected and you try to connect another device with the same id, the existing device should disconnect itself but it also disconnects the new device.
The logs are the following:

{"level":"debug","listenAddress":"[::]:7000","listenNetwork":"tcp","msg":"accepted connection","remoteAddress":"127.0.0.1:32772","ts":"2019-10-22T16:12:58.0593416Z"} {"caller":"manager.go:144","level":"debug","msg":"device connect","ts":"2019-10-22T16:12:58.0593416Z","url":"/api/v2/device"} {"caller":"manager.go:169","id":"mac:000000000000","level":"debug","localAddress":"127.0.0.1:7000","msg":"websocket upgrade complete","ts":"2019-10-22T16:12:58.0623428Z"} {"caller":"handlers.go:227","id":"mac:000000000000","level":"debug","msg":"Connected device","ts":"2019-10-22T16:12:58.0693426Z"} {"caller":"manager.go:383","id":"mac:000000000000","level":"debug","msg":"explicit shutdown","ts":"2019-10-22T16:12:58.0703468Z"} {"caller":"manager.go:316","id":"mac:000000000000","level":"debug","msg":"writePump starting","ts":"2019-10-22T16:12:58.0703468Z"} {"caller":"manager.go:240","id":"mac:000000000000","level":"debug","msg":"readPump starting","ts":"2019-10-22T16:12:58.0703468Z"} {"caller":"manager.go:254","error":"read tcp 127.0.0.1:7000-\u003e127.0.0.1:32770: use of closed network connection","id":"mac:000000000000","level":"error","msg":"read error","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:216","id":"mac:000000000000","level":"debug","msg":"pump close","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:223","error":"close tcp 127.0.0.1:7000-\u003e127.0.0.1:32770: use of closed network connection","id":"mac:000000000000","level":"error","msg":"Error closing device connection","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:385","id":"mac:000000000000","level":"debug","msg":"writePump exiting","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:255","id":"mac:000000000000","level":"debug","msg":"readPump exiting","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:383","id":"mac:000000000000","level":"debug","msg":"explicit shutdown","ts":"2019-10-22T16:12:58.0713422Z"} {"caller":"manager.go:216","id":"mac:000000000000","level":"debug","msg":"pump close","ts":"2019-10-22T16:12:58.0723412Z"} {"caller":"manager.go:223","error":"close tcp 127.0.0.1:7000-\u003e127.0.0.1:32772: use of closed network connection","id":"mac:000000000000","level":"error","msg":"Error closing device connection","ts":"2019-10-22T16:12:58.0723412Z"} {"caller":"manager.go:385","id":"mac:000000000000","level":"debug","msg":"writePump exiting","ts":"2019-10-22T16:12:58.0723412Z"} {"caller":"manager.go:254","error":"read tcp 127.0.0.1:7000-\u003e127.0.0.1:32772: use of closed network connection","id":"mac:000000000000","level":"error","msg":"read error","ts":"2019-10-22T16:12:58.0723412Z"} {"caller":"manager.go:255","id":"mac:000000000000","level":"debug","msg":"readPump exiting","ts":"2019-10-22T16:12:58.0723412Z"}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions