title: Multiplex Select not receiving value from channel Golang
body: <p>So I am trying to send a packet over UDP and receive a ACK from my client.</p>
  <p>When I start my sendFile program and leave my client off for the first few seconds the first packet sent will of course be lost (the client is off at start). However, when i start the client the client receives the packet, sends the ACK back but my channel never receives this value.</p>
  <p>My comment</p>
  <blockquote>
  <p>log.Printf(&quot;And now im sad&quot;)</p>
  </blockquote>
  <p>executes so the channel isn't blocking yet the switch never executes the case where the stopWait returns false.</p>
  <pre><code>case &lt;-chan1:
  // log.Printf(&quot;Received ACK: %v&quot;, string(ack[l-3:]))
  return false
  </code></pre>
  <pre><code>func (s*Sender) Send(){
  stopWait := func(conn *net.UDPConn, current int) bool {
          ack := make([]byte, 20)
          chan1 := make(chan int, 10)
          go func() {
  
              length, _, err := conn.ReadFromUDP(ack)
              log.Printf(&quot;Ack length: %v Ack: %v&quot;, length, string(ack))
  
              // log.Printf(&quot;Channel Value: %v&quot;, &lt;-chan1)
              if err != nil {
                  log.Fatalf(&quot;Error reading from UDP in StopNWait: %v&quot;, err)
              }
              log.Printf(&quot;We got here and broke&quot;)
              chan1 &lt;- length
              log.Printf(&quot;And now im sad&quot;)
          }()
  
          select {
  
          case &lt;-time.After(10 * time.Second):
              log.Printf(&quot;PACKET LOSS&quot;)
  
              return true
          case &lt;-chan1:
              // log.Printf(&quot;Received ACK: %v&quot;, string(ack[l-3:]))
              return false
  
          }
  
  
  for {
  
              _, err := send(conn, dst, i)
              log.Printf(&quot;resend(conn, %v, %v)&quot;, dst.String(), i)
              if err != nil {
                  log.Fatal(err)
              }
              resend := stopWait(conn, i)
              log.Printf(&quot;stopWait(conn, %v) = %v &quot;, i, resend)
              if !resend {
                  break
              }
  
  }
  
  }
  
  </code></pre>