(wg *thread.Group, index int, sendch *common.Channel, recvch *common.Channel, serverconn *ServerConn, pongflag *int32, pongtime *int64)
| 206 | } |
| 207 | |
| 208 | func (c *Client) process(wg *thread.Group, index int, sendch *common.Channel, recvch *common.Channel, serverconn *ServerConn, pongflag *int32, pongtime *int64) error { |
| 209 | |
| 210 | loggo.Info("process start %s", serverconn.conn.Info()) |
| 211 | |
| 212 | for !wg.IsExit() { |
| 213 | |
| 214 | ff := <-recvch.Ch() |
| 215 | if ff == nil { |
| 216 | break |
| 217 | } |
| 218 | f := ff.(*ProxyFrame) |
| 219 | switch f.Type { |
| 220 | case FRAME_TYPE_LOGINRSP: |
| 221 | c.processLoginRsp(wg, index, f, sendch, serverconn) |
| 222 | |
| 223 | case FRAME_TYPE_PING: |
| 224 | processPing(f, sendch, &serverconn.ProxyConn, pongflag, pongtime) |
| 225 | |
| 226 | case FRAME_TYPE_PONG: |
| 227 | processPong(f, sendch, &serverconn.ProxyConn, c.config.ShowPing) |
| 228 | |
| 229 | case FRAME_TYPE_DATA: |
| 230 | c.processData(f, serverconn) |
| 231 | |
| 232 | case FRAME_TYPE_OPEN: |
| 233 | c.processOpen(f, serverconn) |
| 234 | |
| 235 | case FRAME_TYPE_OPENRSP: |
| 236 | c.processOpenRsp(f, serverconn) |
| 237 | |
| 238 | case FRAME_TYPE_CLOSE: |
| 239 | c.processClose(f, serverconn) |
| 240 | } |
| 241 | } |
| 242 | loggo.Info("process end %s", serverconn.conn.Info()) |
| 243 | return nil |
| 244 | } |
| 245 | |
| 246 | func (c *Client) processLoginRsp(wg *thread.Group, index int, f *ProxyFrame, sendch *common.Channel, serverconn *ServerConn) { |
| 247 | if !f.LoginRspFrame.Ret { |
no test coverage detected