Panic: too many concurrent operations on a single file or socket (max 1048575)

I am getting the error panic: too many concurrent operations on a single file or socket (max 1048575)

the code is :

for  {
	buffer := make([]byte, 8)
	n, addr, err := c.ReadFromUDP(buffer)
	if err !=nil {
		fmt.Println(err)
		fmt.Println(buffer)
	}


	fmt.Print("-> ", string(buffer[0:n-1]))

	if strings.TrimSpace(string(buffer[0:n])) == "STOP" {
		fmt.Println("Exiting UDP server!")
		return
	}

	fmt.Println("address ",addr)
	data := []byte("la");
	_, err = c.WriteToUDP(data, addr)
	if err != nil{
		fmt.Println(err)
	}

}

As the panic message implies, you the maximum number of concurrent operations that can execute on a file descriptor is 1048575 and this function must have attempted to execute operation #1048576 which is too many. The solution is to refactor your code so you do not have 1048576 concurrent operations on that UDP connection.