Removed unused printline
Implemented a method to check the connection status. Reopening it when
it is closed.