-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
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)
}gophertunnel/minecraft/dial.go
Lines 201 to 206 in e71aed7
| 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) | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels