Skip to content

Commit

Permalink
Fix Windows networking
Browse files Browse the repository at this point in the history
After a short time if :0 is used (instead of 0.0.0.0:0) the following
error would be printed

```
err: write udp [::]:50147->172.31.22.172:50149: sendmsg: The system detected an invalid pointer address in attempting to use a pointer argument in a call.
```
  • Loading branch information
Sean-Der committed May 14, 2018
1 parent 575a830 commit 5e3d1a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/allocation/allocation-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func CreateAllocation(fiveTuple *FiveTuple, turnSocket *ipv4.PacketConn, lifetim
TurnSocket: turnSocket,
}

listener, err := net.ListenPacket("udp", ":0")
listener, err := net.ListenPacket("udp4", "0.0.0.0:0")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion turn.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ type StartArguments struct {

// Start the Pion TURN server
func Start(args StartArguments) {
fmt.Println(server.NewServer(args.Realm, args.Server.AuthenticateRequest).Listen("", args.UDPPort))
fmt.Println(server.NewServer(args.Realm, args.Server.AuthenticateRequest).Listen("0.0.0.0", args.UDPPort))
}

0 comments on commit 5e3d1a0

Please sign in to comment.