Skip to content

Commit c27cefe

Browse files
committed
fix(coffee): update socket service to match javascript version
1 parent 6d29957 commit c27cefe

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Diff for: app/templates/client/components/socket(socketio)/socket.service(coffee).coffee

+4-10
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,13 @@
44

55
angular.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

0 commit comments

Comments
 (0)