From abd754d0cc8b6079caa0735c428102127416cc25 Mon Sep 17 00:00:00 2001 From: hy05190134 Date: Wed, 20 Apr 2016 11:54:16 +0800 Subject: [PATCH] Update outboundconn.go add 10s timeout for handshake and add onStatus feedback for OUTBOUND_CONN_STATUS_HANDSHAKE_OK --- outboundconn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/outboundconn.go b/outboundconn.go index 386509e..1af8b9b 100644 --- a/outboundconn.go +++ b/outboundconn.go @@ -92,7 +92,7 @@ func Dial(url string, handler OutboundConnHandler, maxChannelNumber int) (Outbou } br := bufio.NewReader(c) bw := bufio.NewWriter(c) - timeout := time.Duration(0) + timeout := time.Duration(10*time.Second) err = Handshake(c, br, bw, timeout) //err = HandshakeSample(c, br, bw, timeout) if err == nil { @@ -106,6 +106,7 @@ func Dial(url string, handler OutboundConnHandler, maxChannelNumber int) (Outbou transactions: make(map[uint32]string), streams: make(map[uint32]OutboundStream), } + obConn.handler.OnStatus(obConn) obConn.conn = NewConn(c, br, bw, obConn, maxChannelNumber) return obConn, nil }