mirror of
https://github.com/zhangpeihao/gortmp
synced 2025-09-26 20:01:11 +08:00
Update outboundconn.go
add 10s timeout for handshake and add onStatus feedback for OUTBOUND_CONN_STATUS_HANDSHAKE_OK
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user