Added support for checking if connection was succesful

Added a method of checking whether a connection to a remote device was
succesful. This allows re-try logic to be built in, or attempt to
connect to the next device.