Commit a77ae6b7 authored by David Fifield's avatar David Fifield
Browse files

Use chan struct{} instead of chan bool in openChan.

http://dave.cheney.net/2014/03/25/the-empty-struct
"...there is one important practical use of empty structs, and that is
the chan struct{} construct used for signaling between go routines"
parent 48db4ac1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ func dialWebRTC(config *webrtc.Configuration, meek *MeekChannel) (

	offerChan := make(chan *webrtc.SessionDescription)
	errChan := make(chan error)
	openChan := make(chan bool)
	openChan := make(chan struct{})

	pc, err := webrtc.NewPeerConnection(config)
	if err != nil {
@@ -151,7 +151,7 @@ func dialWebRTC(config *webrtc.Configuration, meek *MeekChannel) (
	}
	dc.OnOpen = func() {
		log.Println("OnOpen channel")
		openChan <- true
		openChan <- struct{}{}
	}
	dc.OnClose = func() {
		log.Println("OnClose channel")