onDisconnected method

void onDisconnected (
  1. Device device,
  2. bool isError,
  3. Object error,
  4. StackTrace stackTrace
)

When the socket connection closes either normally or due to an error, this method is called. If the connection closed without error, isError will be false. If an error occurred, you can retrieve the error using error. stackTrace may be null is the error provider does not send one. device contains the object to the Device that was disconnected. If device is null, this means that the Host was unable to start the socket.

Implementation

void onDisconnected(Device device, bool isError, Object error, StackTrace stackTrace);