Skip to content

Commit

Permalink
fix(coffee): update socket service to match javascript version
Browse files Browse the repository at this point in the history
  • Loading branch information
DaftMonk committed Jul 30, 2014
1 parent 6d29957 commit c27cefe
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@

angular.module '<%= scriptAppName %>'
.factory 'socket', (socketFactory) ->
retryInterval = 5000
retryTimer = undefined
clearInterval retryTimer
ioSocket = io.connect '',
'force new connection': true
'max reconnection attempts': Infinity

# socket.io now auto-configures its connection when we omit a connection url
ioSocket = io null,
'reconnection limit': 10 * 1000
# Send auth token on connection
# Send auth token on connection, you will need to DI the Auth service above
# 'query': 'token=' + Auth.getToken()

retryTimer = setInterval ->
ioSocket.connect() if not ioSocket.socket.connected and not ioSocket.socket.connecting and not ioSocket.socket.reconnecting
, retryInterval
socket = socketFactory ioSocket: ioSocket

socket: socket
Expand Down

0 comments on commit c27cefe

Please sign in to comment.