code: func (s *Server) CreateSessionV4(p *Packet) (interface{}, error) {
  	const SessionMaxPacketSizeValid = 0x1
  
  	req := new(RequestCreateSessionV4)
  	err := UnmarshalBinary(p.Payload, req)
  	if err != nil {
  		return nil, err
  	}
  
  	res := &ReplyCreateSessionV4{
  		SessionID:       uint64(rand.Int63()),
  		NumCapabilities: uint32(len(s.Capabilities)),
  		MaxPacketSize:   LargePacketMax,
  		Flags:           SessionMaxPacketSizeValid,
  		Capabilities:    s.Capabilities,
  	}
  
  	s.mu.Lock()
  	defer s.mu.Unlock()
  	if len(s.sessions) > maxSessions {
  		return nil, &Status{Code: StatusTooManySessions}
  	}
  
  	s.sessions[res.SessionID] = newSession()
  
  	return res, nil
  }
docs: // CreateSessionV4 handls OpCreateSessionV4 requests