From 3a9b465c750df57d51c5e2297fc9082cc16c464b Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Mon, 20 Jul 2015 16:55:25 -0700 Subject: [PATCH] Fix MConnection race condiiton --- p2p/connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/connection.go b/p2p/connection.go index 30452e49..9fcb9831 100644 --- a/p2p/connection.go +++ b/p2p/connection.go @@ -129,11 +129,11 @@ func NewMConnection(conn net.Conn, chDescs []*ChannelDescriptor, onReceive recei func (c *MConnection) AfterStart() { c.quit = make(chan struct{}) - go c.sendRoutine() - go c.recvRoutine() c.flushTimer = NewThrottleTimer("flush", flushThrottleMS*time.Millisecond) c.pingTimer = NewRepeatTimer("ping", pingTimeoutSeconds*time.Second) c.chStatsTimer = NewRepeatTimer("chStats", updateStatsSeconds*time.Second) + go c.sendRoutine() + go c.recvRoutine() } func (c *MConnection) AfterStop() {