@@ -25,3 +25,10 @@ func StrChannelFilter(channel string) FilterFunc {
return strings.Contains(conn.channel, channel)
}
+
+// 连接过滤器
+func LineLinkFilter(line *Line) FilterFunc {
+ return func(conn *Line) (ok bool) {
+ return line == conn
+ }
+}
@@ -338,7 +338,7 @@ func (h *Hub) sendRequest(gd *GetData) (count int) {
return 0
} else {
- time.Sleep(time.Millisecond * 500)
+ time.Sleep(time.Millisecond * 400) // 故意将时间缩小一点
return