If the server doesn't respond to raknet pings this will block forever until the context times out.
It should be like this, pings usually respond in <1s
// Try pinging first with a short timeout so we don't block the dial
// if the server has pinging blocked.
pingCtx, pingCancel := context.WithTimeout(ctx, time.Second*3)
pong, err = n.PingContext(pingCtx, address)
pingCancel()
if err == nil {
netConn, err = n.DialContext(ctx, addressWithPongPort(pong, address))
} else {
netConn, err = n.DialContext(ctx, address)
}
|
var netConn net.Conn |
|
if pong, err = n.PingContext(ctx, address); err == nil { |
|
netConn, err = n.DialContext(ctx, addressWithPongPort(pong, address)) |
|
} else { |
|
netConn, err = n.DialContext(ctx, address) |
|
} |
If the server doesn't respond to raknet pings this will block forever until the context times out.
It should be like this, pings usually respond in <1s
gophertunnel/minecraft/dial.go
Lines 201 to 206 in e71aed7