Close callback for when the connection is closed
typedef OnCloseCallback = void Function(int code, String reason);