go - Can you target a specific port using icmp? -


i believe title pretty self explanatory, in case, i'll explain further.

i writing function in go uses icmp check if particular service running. got idea ping implemented in go. when try command line ping, can not resolve 127.0.0.1:8080, , function follows suit, makes sense. can use icmp check address , port missing? or should stick tcp target port?

right have simple function, , could use tcp, i'm curious if use icmp.

func (c *controller) ping() error {     conn, connerr := net.dial("ip4:icmp", c.apiserverip)     if connerr != nil {         return connerr     }     conn.setdeadline(time.now().add(3 * time.second))     defer conn.close()     return nil } 

no. there no ports in icmp.

if want know whether specific tcp server running, try connect it.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -