made udp4 socket default bind to an ipv4 address
it seems that on windows, binding a udp4 socket to an ipv6 address (here is ::1) raises and EINVAL error
This commit is contained in:
parent
e9d34a8178
commit
36457fa5bd
1 changed files with 4 additions and 0 deletions
|
@ -203,6 +203,10 @@ function serveNet(host,port,UDPType,callback){
|
||||||
|
|
||||||
if(UDPType){
|
if(UDPType){
|
||||||
this.server[UDPType]=true;
|
this.server[UDPType]=true;
|
||||||
|
if(UDPType === "udp4" && host === "::1") {
|
||||||
|
// bind udp4 socket to an ipv4 address to avoid failing on windows
|
||||||
|
this.server.path = "127.0.0.1";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.server.on(
|
this.server.on(
|
||||||
|
|
Loading…
Reference in a new issue