fix: close connection on EOF so reconnect logic can work