mirror of
https://github.com/amark/gun.git
synced 2025-06-08 07:06:44 +00:00
multicast fix
This commit is contained in:
parent
fe3a25682a
commit
ff9ff71cb2
@ -22,11 +22,10 @@ Gun.on('create', function(root){
|
|||||||
socket.bind({port: udp.port, exclusive: true}, function(){
|
socket.bind({port: udp.port, exclusive: true}, function(){
|
||||||
socket.setBroadcast(true);
|
socket.setBroadcast(true);
|
||||||
socket.setMulticastTTL(128);
|
socket.setMulticastTTL(128);
|
||||||
try{ socket.addMembership(udp.address); }catch(e){}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("listening", function(){
|
socket.on("listening", function(){
|
||||||
try { socket.addMembership(udp.address) }catch(e){ return }
|
try { socket.addMembership(udp.address) }catch(e){ console.error(e); return; }
|
||||||
udp.peer = {id: udp.address + ':' + udp.port, wire: socket};
|
udp.peer = {id: udp.address + ':' + udp.port, wire: socket};
|
||||||
|
|
||||||
udp.peer.say = function(raw){
|
udp.peer.say = function(raw){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user