File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
app/templates/client/components/socket(socketio) Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 44
55angular .module ' <%= scriptAppName %>'
66.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 ,
1310 ' 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
1512 # 'query': 'token=' + Auth.getToken()
1613
17- retryTimer = setInterval ->
18- ioSocket .connect () if not ioSocket .socket .connected and not ioSocket .socket .connecting and not ioSocket .socket .reconnecting
19- , retryInterval
2014 socket = socketFactory ioSocket : ioSocket
2115
2216 socket : socket
You can’t perform that action at this time.
0 commit comments