humblenginr / goocoin

Full bitcoin solution written in Go (golang)
Other
0 stars 0 forks source link

Gateway does not reconnect when client gets restarted #12

Closed piotrnar closed 2 months ago

piotrnar commented 2 months ago

When gateway is connected to the client and we close the client, it prints errors:

failed to read JSON message: failed to get reader: failed to read frame header: EOF
failed to write JSON message: failed to marshal JSON: failed to write msg: failed to write frame: failed to flush: write tcp 192.168.0.83:41174->88.99.248.50:8878: write: broken pipe

... and keeps running.

When the client is restarted, the gateway does not reconnect.

The expected behavior would be to automatically reconnect. Or at least exit when the connection gets terminated, so the user knows that it needs to be restarted.

humblenginr commented 2 months ago

fixed in https://github.com/piotrnar/gocoin/pull/68/commits/a1f88bfeaa2bd7390e52d140a0b633904760f17e.

gateway will terminate when the connection with the client has been broken.

piotrnar commented 2 months ago

ok