Poll a Connection


(Chris) #1

Let’s say I have a simple tls dial happening:

conn, err := tls.Dial(“tcp”, 192.168.1.10)

After this dial, I have a for loop printing “connected”:

fmt.Println(“Connected”)

How can I make sure the initial tls.Dial is still active? Is there a way to specify a timeout threshold? I’d like to have an if statement, something like:

if conn fails; tls.Close


(Chris) #2

I think I answered my own question. I can use: https://golang.org/pkg/net/#Dialer


(Chris) #3

I take that back.


(system) closed #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.