Merge pull request #41 from Joebayld/patch-2

Add broadcast support to socket
This commit is contained in:
Sebastian Wiedenroth 2018-01-11 22:07:36 +01:00 committed by GitHub
commit bb393fe30c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,9 @@ function EnttecODE(device_id, options) {
self.host = device_id || '127.0.0.1'
self.port = options.port || 6454
self.dev = dgram.createSocket('udp4')
self.dev.bind(function() {
self.dev.setBroadcast(true)
})
self.start()
}