mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 13:25:40 +00:00
switch to DialUDP
This commit is contained in:
@@ -62,7 +62,11 @@ func (uc *UDPClient) RegisterRouter(router *Router) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (uc *UDPClient) Run(ctx context.Context) error {
|
func (uc *UDPClient) Run(ctx context.Context) error {
|
||||||
client, err := net.Dial("udp", fmt.Sprintf(":%d", uc.Port))
|
addr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", uc.Host, uc.Port))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
client, err := net.DialUDP("udp", nil, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user