Skip to content

Commit

Permalink
Duplicate udp server options
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeboeck committed Jan 23, 2024
1 parent c61c648 commit 20808a5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ func ListenAndServeWithOptions(network, addr string, opts ...any) (err error) {
switch o := opt.(type) {
case tcpServer.Option:
tcpOptions = append(tcpOptions, o)

// Duplicate the option for UDP if needed.
if udpOpt, ok := o.(udpServer.Option); ok {
udpOptions = append(udpOptions, udpOpt)
}
case udpServer.Option:
udpOptions = append(udpOptions, o)
default:
Expand Down

0 comments on commit 20808a5

Please sign in to comment.