package net import ( "git.noahlan.cn/northlan/nnet/interfaces" "net" ) type Request struct { session interfaces.ISession // Session server *Server // Server reference conn net.Conn // low-level conn fd status Status // 连接状态 } func newRequest(server *Server, conn net.Conn) *Request { r := &Request{ server: server, conn: conn, status: StatusStart, } r.session = newSession() return r } func (r *Request) Status() Status { return r.status } func (r *Request) ID() int64 { return r.session.ID() } func (r *Request) Session() interfaces.ISession { return r.session }