Revert "Merge pull request #28 from p4u/master"
This reverts commit33a2857c2d, reversing changes made toc08788cb06.
This commit is contained in:
@@ -54,8 +54,6 @@ type RecConn struct {
|
||||
httpResp *http.Response
|
||||
dialErr error
|
||||
dialer *websocket.Dialer
|
||||
// if set to true, close stops dial reconnection
|
||||
close chan (bool)
|
||||
|
||||
*websocket.Conn
|
||||
}
|
||||
@@ -89,7 +87,7 @@ func (rc *RecConn) Close() {
|
||||
rc.Conn.Close()
|
||||
rc.mu.Unlock()
|
||||
}
|
||||
rc.close <- true
|
||||
|
||||
rc.setIsConnected(false)
|
||||
}
|
||||
|
||||
@@ -292,7 +290,6 @@ func (rc *RecConn) Dial(urlStr string, reqHeader http.Header) {
|
||||
log.Fatalf("Dial: %v", err)
|
||||
}
|
||||
|
||||
rc.close = make(chan bool, 1)
|
||||
// Config
|
||||
rc.setURL(urlStr)
|
||||
rc.setReqHeader(reqHeader)
|
||||
@@ -397,10 +394,6 @@ func (rc *RecConn) connect() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-rc.close:
|
||||
return
|
||||
default:
|
||||
nextItvl := b.Duration()
|
||||
wsConn, httpResp, err := rc.dialer.Dial(rc.url, rc.reqHeader)
|
||||
|
||||
@@ -439,7 +432,6 @@ func (rc *RecConn) connect() {
|
||||
|
||||
time.Sleep(nextItvl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetHTTPResponse returns the http response from the handshake.
|
||||
|
||||
Reference in New Issue
Block a user