You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A list of the transports to attempt to utilize (in order of preference)
97
+
A list of the transports to attempt to utilize (in order of preference).
100
98
101
99
-*transportOptions*
102
100
@@ -109,11 +107,48 @@ Options:
109
107
110
108
An object containing (optional) options to pass to each transport.
111
109
112
-
Properties:
110
+
-*rememberTransport*
111
+
112
+
true
113
+
114
+
A boolean indicating if the utilized transport should be remembered in a cookie.
115
+
116
+
-*connectTimeout*
117
+
118
+
5000
119
+
120
+
The amount of miliseconds a transport has to create a connection before we consider it timed out.
121
+
122
+
-*tryTransportsOnConnectTimeout*
123
+
124
+
true
125
+
126
+
A boolean indicating if we should try other transports when the connectTimeout occurs.
127
+
128
+
-*reconnect*
129
+
130
+
true
131
+
132
+
A boolean indicating if we should automatically reconnect if a connection is disconnected.
133
+
134
+
-*reconnectionDelay*
135
+
136
+
500
137
+
138
+
The amount of milliseconds before we try to connect to the server again. We are using a exponential back off algorithm for the following reconnections, on each reconnect attempt this value will get multiplied (500 > 1000 > 2000 > 4000 > 8000).
139
+
140
+
141
+
-*maxReconnectionAttempts*
142
+
143
+
10
144
+
145
+
The amount of attempts should we make using the current transport to connect to the server? After this we will do one final attempt, and re-try with all enabled transport methods before we give up.
146
+
147
+
##### Properties:
113
148
114
149
-*options*
115
150
116
-
The passed in options combined with the defaults
151
+
The passed in options combined with the defaults.
117
152
118
153
-*connected*
119
154
@@ -122,46 +157,50 @@ Properties:
122
157
-*connecting*
123
158
124
159
Whether the socket is connecting or not.
160
+
161
+
-*reconnecting*
162
+
163
+
Whether we are reconnecting or not.
125
164
126
165
-*transport*
127
166
128
167
The transport instance.
129
168
130
-
Methods:
169
+
##### Methods:
131
170
132
171
-*connect*
133
172
134
-
Establishes a connection
173
+
Establishes a connection.
135
174
136
175
-*send(message)*
137
176
138
177
A string of data to send.
139
178
140
179
-*disconnect*
141
180
142
-
Closes the connection
181
+
Closes the connection.
143
182
144
183
-*on(event, λ)*
145
184
146
-
Adds a listener for the event *event*
185
+
Adds a listener for the event *event*.
147
186
148
187
-*removeEvent(event, λ)*
149
188
150
-
Removes the listener λ for the event *event*
189
+
Removes the listener λ for the event *event*.
151
190
152
-
Events:
191
+
##### Events:
153
192
154
193
-*connect*
155
194
156
-
Fired when the connection is established and the handshake successful
195
+
Fired when the connection is established and the handshake successful.
157
196
158
197
-*connecting(transport_type)*
159
198
160
-
Fired when a connection is attempted, passing the transport name
199
+
Fired when a connection is attempted, passing the transport name.
161
200
162
201
-*connect_failed*
163
202
164
-
Fired when the connection timeout occurs after the last connection attempt.
203
+
Fired when the connection timeout occurs after the last connection attempt.
165
204
This only fires if the `connectTimeout` option is set.
166
205
If the `tryTransportsOnConnectTimeout` option is set, this only fires once all
167
206
possible transports have been tried.
@@ -177,11 +216,26 @@ Events:
177
216
-*disconnect*
178
217
179
218
Fired when the connection is considered disconnected.
219
+
220
+
-*reconnect(transport_type,reconnectionAttempts)*
221
+
222
+
Fired when the connection has been re-established. This only fires if the `reconnect` option is set.
0 commit comments