File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type WsParameter struct {
1010 ReqHeaders map [string ][]string
1111 Dialer * websocket.Dialer
1212 MessageHandleFunc func ([]byte ) error
13- ReSubscribeFunc func () error // 短线重连后触发,你可以重新订阅,因为有些订阅跟当前时间相关
13+ ReSubscribeFunc func (ws * WsConn ) error // 短线重连后触发,你可以重新订阅,因为有些订阅跟当前时间相关
1414 ErrorHandleFunc func (err error )
1515 AutoReconnect bool // 自动重连(默认: true)
1616 ReSubscribe bool // 自动重新订阅(默认: true)
@@ -62,7 +62,7 @@ func WsMessageHandleFuncOption(f func([]byte) error) WsParameterOption {
6262 }
6363}
6464
65- func WsReSubscribeFuncOption (f func () error ) WsParameterOption {
65+ func WsReSubscribeFuncOption (f func (ws * WsConn ) error ) WsParameterOption {
6666 return func (p * WsParameter ) {
6767 p .ReSubscribeFunc = f
6868 }
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ func (ws *WsConn) reconnect() {
8383 }
8484 }
8585 if ws .ReSubscribeFunc != nil {
86- err = ws .ReSubscribeFunc ()
86+ err = ws .ReSubscribeFunc (ws )
8787 if err != nil {
8888 log .Printf ("[ws] websocket re-subscribe fail, %s" , err .Error ())
8989 }
You can’t perform that action at this time.
0 commit comments