mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
switch to DialTCP
This commit is contained in:
@@ -92,8 +92,12 @@ func (tc *TCPClient) RegisterRouter(router *Router) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tc *TCPClient) Run(ctx context.Context) error {
|
func (tc *TCPClient) Run(ctx context.Context) error {
|
||||||
|
addr, err := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%d", tc.Host, tc.Port))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
client, err := net.Dial("tcp", fmt.Sprintf(":%d", tc.Port))
|
client, err := net.DialTCP("tcp", nil, addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error(err.Error())
|
slog.Error(err.Error())
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user