MCPcopy Create free account
hub / github.com/esrrhs/spp / process

Method process

proxy/client.go:208–244  ·  view source on GitHub ↗
(wg *thread.Group, index int, sendch *common.Channel, recvch *common.Channel, serverconn *ServerConn, pongflag *int32, pongtime *int64)

Source from the content-addressed store, hash-verified

206}
207
208func (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
246func (c *Client) processLoginRsp(wg *thread.Group, index int, f *ProxyFrame, sendch *common.Channel, serverconn *ServerConn) {
247 if !f.LoginRspFrame.Ret {

Callers 1

useServerMethod · 0.95

Calls 7

processLoginRspMethod · 0.95
processDataMethod · 0.95
processOpenMethod · 0.95
processOpenRspMethod · 0.95
processCloseMethod · 0.95
processPingFunction · 0.85
processPongFunction · 0.85

Tested by

no test coverage detected