Golang net.DialTCP() function example
package net
Golang net.DialTCP() function usage example
target := "127.1.0.1:8080"
raddr,e := net.ResolveTCPAddr("tcp",target)
if err != nil {
fmt.Println(err)
return 1
}
conn, err := net.DialTCP("tcp",nil,raddr)
if err != nil {
fmt.Println(err)
return 1
}
localAddr := conn.LocalAddr()
fmt.Println(localAddr)
References :
Advertisement
Something interesting
Tutorials
+19.2k Golang : Execute shell command
+14.3k Golang : Get uploaded file name or access uploaded files
+11k Golang : Generate random elements without repetition or duplicate
+32.5k Golang : Copy directory - including sub-directories and files
+5.8k Unix/Linux : How to test user agents blocked successfully ?
+11.2k CodeIgniter : How to check if a session exist in PHP?
+7.5k Golang : Shuffle strings array
+7.9k Golang : How to feed or take banana with Gorilla Web Toolkit Session package
+17.6k Golang : delete and modify XML file content
+9.1k Golang : Intercept and compare HTTP response code example
+7.4k Android Studio : How to detect camera, activate and capture example
+36.4k Golang : Convert date or time stamp from string to time.Time type