File tree 1 file changed +4
-10
lines changed
app/templates/client/components/socket(socketio)
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
angular .module ' <%= scriptAppName %>'
6
6
.factory ' socket' , (socketFactory ) ->
7
- retryInterval = 5000
8
- retryTimer = undefined
9
- clearInterval retryTimer
10
- ioSocket = io .connect ' ' ,
11
- ' force new connection' : true
12
- ' max reconnection attempts' : Infinity
7
+
8
+ # socket.io now auto-configures its connection when we omit a connection url
9
+ ioSocket = io null ,
13
10
' reconnection limit' : 10 * 1000
14
- # Send auth token on connection
11
+ # Send auth token on connection, you will need to DI the Auth service above
15
12
# 'query': 'token=' + Auth.getToken()
16
13
17
- retryTimer = setInterval ->
18
- ioSocket .connect () if not ioSocket .socket .connected and not ioSocket .socket .connecting and not ioSocket .socket .reconnecting
19
- , retryInterval
20
14
socket = socketFactory ioSocket : ioSocket
21
15
22
16
socket : socket
You can’t perform that action at this time.
0 commit comments