title: Golang send and receive udp packets simultaneously
body: <p>I have a little problem. I want to receive and write udp packets with a DialUDP function. The problem is that it only can write and not receive udp packets (i think). How can i send a packet and let the program wait on a respond from the server?</p>
  
  <p>my code:</p>
  
  <pre><code>if programPacketType == "udp"{
      server,err := net.ResolveUDPAddr("udp4", programAddressInput)
      checkError(err)
      lServer, err := net.ResolveUDPAddr("udp4", programLocalAddressInput)
      checkError(err)
  
  
      conn, err := net.DialUDP("udp4", server, lServer)
      checkError(err)
  
      i := 0
      for {
          msg := strconv.Itoa(i)
          i++
          buf := []byte(msg)
          _,err := conn.Write(buf)
          if err != nil {
              fmt.Println(msg, err)
          }
          fmt.Println("sended:", i, "to connected server")
          time.Sleep(time.Second * 1)
      }
  }
  </code></pre>
  
  <p>thanks.</p>
  
  <p>(Pls ignore grammatical mistakes,)</p>