Manager class represents a connection to a given Socket.IO server.
| 20 | * Manager class represents a connection to a given Socket.IO server. |
| 21 | */ |
| 22 | public class Manager extends Emitter { |
| 23 | |
| 24 | private static final Logger logger = Logger.getLogger(Manager.class.getName()); |
| 25 | |
| 26 | /*package*/ enum ReadyState { |
| 27 | CLOSED, OPENING, OPEN |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Called on a successful connection. |
| 32 | */ |
| 33 | public static final String EVENT_OPEN = "open"; |
| 34 | |
| 35 | /** |
| 36 | * Called on a disconnection. |
| 37 | */ |
| 38 | public static final String EVENT_CLOSE = "close"; |
| 39 | |
| 40 | public static final String EVENT_PACKET = "packet"; |
| 41 | public static final String EVENT_ERROR = "error"; |
| 42 | |
| 43 | /** |
| 44 | * Called on a successful reconnection. |
| 45 | */ |
| 46 | public static final String EVENT_RECONNECT = "reconnect"; |
| 47 | |
| 48 | /** |
| 49 | * Called on a reconnection attempt error. |
| 50 | */ |
| 51 | public static final String EVENT_RECONNECT_ERROR = "reconnect_error"; |
| 52 | |
| 53 | public static final String EVENT_RECONNECT_FAILED = "reconnect_failed"; |
| 54 | |
| 55 | public static final String EVENT_RECONNECT_ATTEMPT = "reconnect_attempt"; |
| 56 | |
| 57 | /** |
| 58 | * Called when a new transport is created. (experimental) |
| 59 | */ |
| 60 | public static final String EVENT_TRANSPORT = Engine.EVENT_TRANSPORT; |
| 61 | |
| 62 | /*package*/ static WebSocket.Factory defaultWebSocketFactory; |
| 63 | /*package*/ static Call.Factory defaultCallFactory; |
| 64 | |
| 65 | /*package*/ ReadyState readyState; |
| 66 | |
| 67 | private boolean _reconnection; |
| 68 | private boolean skipReconnect; |
| 69 | private boolean reconnecting; |
| 70 | private boolean encoding; |
| 71 | private int _reconnectionAttempts; |
| 72 | private long _reconnectionDelay; |
| 73 | private long _reconnectionDelayMax; |
| 74 | private double _randomizationFactor; |
| 75 | private final Backoff backoff; |
| 76 | private long _timeout; |
| 77 | private final URI uri; |
| 78 | private final List<Packet> packetBuffer = new ArrayList<>(); |
| 79 | private final Queue<On.Handle> subs = new LinkedList<>();; |
nothing calls this directly
no outgoing calls
no test coverage detected