// AddAndWait queues a new DATAGRAM frame for sending.
// It blocks until the frame has been dequeued.
AddAndWait queues a new DATAGRAM frame for sending.
It blocks until the frame has been dequeued.
// AddAndWait queues a new DATAGRAM frame for sending . // It blocks until the frame has been dequeued .
func (h *datagramQueue) AddAndWait(f *wire.DatagramFrame) error {
	select {
	case h.sendQueue <- f:
		h.hasData()
	case <-h.closed:
		return h.closeErr
	}
	select {
	case <-h.dequeued:
		return nil
	case <-h.closed:
		return h.closeErr
	}
}
func ( h * datagramQueue ) AddAndWait ( f * wire . DatagramFrame ) error { select { case h . sendQueue <- f : h . hasData ( ) case <- h . closed : return h . closeErr } select { case <- h . dequeued : return nil case <- h . closed : return h . closeErr } }
AddAndWait queues a new DATAGRAM frame for sending.
AddAndWait queues a new DATAGRAM frame for sending .