All I/O types require the following methods below.
Unless specified,
all of the methods should report a true value on success or undef on error.
The methods are responsible for their own error logging.

Called after the interval loop has been completed. This should close the connection and run through any cleanup.

This method should double-check all I/O cleanup with the opened method to ensure that close doesn't fail. This is important if the loop detects that the opened method is false, since it will try a close before trying to re-open.

Persistent connections can be done by defining close in such a way that it still keeps the connection online, and making sure opened can handle the state. Take special care to check that the connection is indeed valid and the module can handle re-opens properly.