mirror of
https://github.com/amark/gun.git
synced 2025-11-29 08:28:55 +00:00
Merge pull request #830 from BillyNate/fixw10multicast
Multicast fix for Windows 10
This commit is contained in:
commit
2b82d6211f
@ -19,7 +19,11 @@ Gun.on('create', function(root){
|
|||||||
|
|
||||||
try{ dgram = require("dgram") }catch(e){ return }
|
try{ dgram = require("dgram") }catch(e){ return }
|
||||||
var socket = dgram.createSocket({type: "udp4", reuseAddr: true});
|
var socket = dgram.createSocket({type: "udp4", reuseAddr: true});
|
||||||
socket.bind(udp.port);
|
socket.bind({port: udp.port, exclusive: true}, function(){
|
||||||
|
socket.setBroadcast(true);
|
||||||
|
socket.setMulticastTTL(128);
|
||||||
|
socket.addMembership(udp.address);
|
||||||
|
});
|
||||||
|
|
||||||
socket.on("listening", function(){
|
socket.on("listening", function(){
|
||||||
try { socket.addMembership(udp.address) }catch(e){ return }
|
try { socket.addMembership(udp.address) }catch(e){ return }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user