func (h *RpcServerHandler) OnOpen(session getty.Session) error {
	var err error
	h.rwlock.RLock()
	if h.maxSessionNum <= len(h.sessionMap) {
		err = errTooManySessions
	}
	h.rwlock.RUnlock()
	if err != nil {
		return perrors.WithStack(err)
	}

	logger.Infof("got session:%s", session.Stat())
	h.rwlock.Lock()
	h.sessionMap[session] = &rpcSession{session: session}
	h.rwlock.Unlock()
	return nil
}
// OnOpen call server session opened, add the session to getty server session list. also onOpen
// will check the max getty server session number
OnOpen call server session opened, add the session to getty server session list. also onOpen
will check the max getty server session number
// OnOpen call server session opened add the session to getty server session list . also onOpen // will check the max getty server session number
func (h *RpcServerHandler) OnOpen(session getty.Session) error {
	var err error
	h.rwlock.RLock()
	if h.maxSessionNum <= len(h.sessionMap) {
		err = errTooManySessions
	}
	h.rwlock.RUnlock()
	if err != nil {
		return perrors.WithStack(err)
	}
	logger.Infof("got session:%s", session.Stat())
	h.rwlock.Lock()
	h.sessionMap[session] = &rpcSession{session: session}
	h.rwlock.Unlock()
	return nil
}
func ( h * RpcServerHandler ) OnOpen ( session getty . Session ) error { var err error h . rwlock . RLock ( ) if h . maxSessionNum <= len ( h . sessionMap ) { err = errTooManySessions } h . rwlock . RUnlock ( ) if err != nil { return perrors . WithStack ( err ) } logger . Infof ( " " , session . Stat ( ) ) h . rwlock . Lock ( ) h . sessionMap [ session ] = & rpcSession { session : session } h . rwlock . Unlock ( ) return nil }
OnOpen call server session opened, add the session to getty server session list.
OnOpen call server session opened add the session to getty server session list .