feat: kill server after n downloads
This commit is contained in:
@@ -17,13 +17,13 @@ func GenerateShareLink(port int) string {
|
||||
}
|
||||
|
||||
func getLocalIP() string {
|
||||
conn, err := net.Dial("udp", "8.8.8.8:80")
|
||||
if err != nil {
|
||||
errx.FatalPerror(err)
|
||||
}
|
||||
defer conn.Close()
|
||||
conn, err := net.Dial("udp", "8.8.8.8:80")
|
||||
if err != nil {
|
||||
errx.FatalPerror(err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
localAddress := conn.LocalAddr().(*net.UDPAddr)
|
||||
localAddress := conn.LocalAddr().(*net.UDPAddr)
|
||||
|
||||
return localAddress.IP.String()
|
||||
return localAddress.IP.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user