Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

remove dangerously named variable #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bridge.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ updateBridgeConfiguration = (newBridgeConfiguration) ->

# Driver sockets

driverSockets = []

writeToDriverSockets = (message) ->
console.log "Received message from server:", JSON.stringify message
protocol = message.protocol
driverSockets = driverSocketsOf protocol
writeMessage = _.assign { command: "write" }, message
driverSockets?.forEach (driverSocket) ->
driverSocketsOf(protocol).forEach (driverSocket) ->
messageAsString = (JSON.stringify writeMessage) + "\n"
driverSocket.write messageAsString
console.log "Wrote message to driver: #{messageAsString}".trim()
Expand Down Expand Up @@ -80,7 +81,6 @@ onDriverSocketConnect = (driverSocket) ->
driverSocket.on 'error', onDriverSocketError(driverSocket)

driverSocketServer = net.createServer onDriverSocketConnect
driverSockets = []

driverSocketsOf = (protocol) ->
_ driverSockets
Expand Down