Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ckousik committed Dec 6, 2022
1 parent 626947f commit 8709645
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p/transport/webrtc/datachannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func newDataChannel(
}

func (d *dataChannel) Read(b []byte) (int, error) {

d.startReadLoop()
timeout := make(chan struct{})
var deadlineTimer *time.Timer
first := true
Expand Down Expand Up @@ -166,6 +166,7 @@ func (d *dataChannel) Write(b []byte) (int, error) {
// Check if there is any message on the wire. This is used for control
// messages only
if state == stateReadClosed {
d.startReadLoop()
// drain the channel
select {
case <-d.receivedMessage:
Expand Down

0 comments on commit 8709645

Please sign in to comment.