Browse files

Merge pull request #31 from rybesh/arrayport-begingroup-bugfix

ArrayPort should only send each beginGroup once.
  • Loading branch information...
2 parents 135f5bf + 2630e66 commit 493bf880e1791ce2f7441a9c3450aef3996df27e @bergie bergie committed Jun 19, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/lib/ArrayPort.coffee
View
6 src/lib/ArrayPort.coffee
@@ -12,7 +12,7 @@ class ArrayPort extends port.Port
if socketId is null
@sockets.forEach (socket) ->
socket.disconnect()
- return
+ return
unless @sockets[socketId]
throw new Error "No socket '#{socketId}' available"
@@ -30,7 +30,7 @@ class ArrayPort extends port.Port
return @sockets[socketId].beginGroup group if @isConnected socketId
- @sockets[socketId].on "connect", =>
+ @sockets[socketId].once "connect", =>
@sockets[socketId].beginGroup group
@sockets[socketId].connect()
@@ -64,7 +64,7 @@ class ArrayPort extends port.Port
if socketId is null
@sockets.forEach (socket) ->
socket.disconnect()
- return
+ return
return unless @sockets[socketId]
@sockets[socketId].disconnect()

0 comments on commit 493bf88

Please sign in to comment.