Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Jun 15, 2020
1 parent 027eedd commit 2620f6a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
13 changes: 0 additions & 13 deletions api/utils/socket.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import * as WebSocket from 'ws'

// let connections = new Map()
// let connectionCounter = 0

// let lastConn: any
let srvr: any

const connect = (server) => {
Expand All @@ -12,20 +8,11 @@ const connect = (server) => {

srvr.on('connection', socket => {
console.log('=> [socket] connection received')
// var id = connectionCounter++;
// connections.set(id, socket)
// lastConn = socket
})

}

const send = (body) => {
// connections.forEach((socket, index) => {
// socket.send(body)
// })
// if(lastConn) lastConn.send(body)
srvr.clients.forEach(c=>{
console.log(c)
if(c) c.send(body)
})
}
Expand Down
11 changes: 0 additions & 11 deletions dist/api/utils/socket.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/api/utils/socket.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2620f6a

Please sign in to comment.