You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 27, 2021. It is now read-only.
In the below function ,when c, err = reuseport.ListenPacket(serverNet, laddr) was executed,this s.conn did not execute ReadFrom method,so when message arrived ,it won't be handled,the client didn't get a response and will throw a transaction is timed out error.
funcListenUDPAndServe(log*zap.Logger, serverNet, laddrstring, u*server.Updater) error {
var (
c net.PacketConnerrerror
)
opt:=u.Get()
ifreuseport.Available() &&opt.ReusePort {
c, err=reuseport.ListenPacket(serverNet, laddr)
iferr!=nil {
// Trying to listen without reuseport.// Sometimes reuseport.Available() can be true, but for subset// of interfaces it is not available.reusePortErr:=errc, err=net.ListenPacket(serverNet, laddr)
iferr==nil {
opt.ReusePort=falselog.Warn("failed to use REUSEPORT, falling back to non-reuseport", zap.Error(reusePortErr))
}
}
} else {
c, err=net.ListenPacket(serverNet, laddr)
}
iferr!=nil {
returnerr
}
opt.Conn=cs, err:=server.New(opt)
iferr!=nil {
returnerr
}
u.Subscribe(s)
returns.Serve()
}
In the below function ,when
c, err = reuseport.ListenPacket(serverNet, laddr)
was executed,thiss.conn
did not executeReadFrom
method,so when message arrived ,it won't be handled,the client didn't get a response and will throw atransaction is timed out
error.add the below code will fixed it
The text was updated successfully, but these errors were encountered: