Browse Source

Fix MConnection race condiiton

pull/117/head
Jae Kwon 10 years ago
parent
commit
3a9b465c75
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      p2p/connection.go

+ 2
- 2
p2p/connection.go View File

@ -129,11 +129,11 @@ func NewMConnection(conn net.Conn, chDescs []*ChannelDescriptor, onReceive recei
func (c *MConnection) AfterStart() { func (c *MConnection) AfterStart() {
c.quit = make(chan struct{}) c.quit = make(chan struct{})
go c.sendRoutine()
go c.recvRoutine()
c.flushTimer = NewThrottleTimer("flush", flushThrottleMS*time.Millisecond) c.flushTimer = NewThrottleTimer("flush", flushThrottleMS*time.Millisecond)
c.pingTimer = NewRepeatTimer("ping", pingTimeoutSeconds*time.Second) c.pingTimer = NewRepeatTimer("ping", pingTimeoutSeconds*time.Second)
c.chStatsTimer = NewRepeatTimer("chStats", updateStatsSeconds*time.Second) c.chStatsTimer = NewRepeatTimer("chStats", updateStatsSeconds*time.Second)
go c.sendRoutine()
go c.recvRoutine()
} }
func (c *MConnection) AfterStop() { func (c *MConnection) AfterStop() {


Loading…
Cancel
Save