fix udp bind

This commit is contained in:
ginuerzh
2021-11-22 17:52:38 +08:00
parent 3fd3b5e801
commit 8861644bbc
18 changed files with 477 additions and 613 deletions

View File

@ -62,9 +62,9 @@ func (tr *Transport) Connect(ctx context.Context, conn net.Conn, network, addres
return tr.connector.Connect(ctx, conn, network, address)
}
func (tr *Transport) Bind(ctx context.Context, conn net.Conn, network, address string) (connector.Accepter, error) {
func (tr *Transport) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error) {
if binder, ok := tr.connector.(connector.Binder); ok {
return binder.Bind(ctx, conn, network, address, connector.MuxBindOption(true))
return binder.Bind(ctx, conn, network, address, opts...)
}
return nil, connector.ErrBindUnsupported
}