// Creates a session for a given message sender.
Creates a session for a given message sender.
Creates a session for a given message sender .
pub fn open(
        session_id: u32,
        config: &Config,
        sender: MessageSender,
        token_manager: SharedTokensManager,
        session_context: SharedSessionContext,
        remote_services_manager: SharedRemoteServiceManager,
        shared_state: SharedStateMap,
    ) -> Self {
        remote_services_manager
            .lock()
            .add_upstream_session(session_id, sender.clone());
        let registrar = remote_services_manager.lock().registrar.clone();
        let id_factory = Shared::adopt(IdFactory::new(0));
        let event_map: SharedEventMap = Shared::default();
        Session {
            session_id,
            state: SessionState::Handshake,
            tracker: ObjectTracker::default(),
            token_manager,
            origin_attributes: None,
            message_max_time: config.general.message_max_time,
            services_names: enabled_services(&config, &registrar),
            context: session_context,
            remote_services_manager,
            shared_state,
            session_helper: SessionSupport::new(
                SessionTrackerId::from(session_id, 0),
                sender,
                id_factory,
                event_map,
            ),
            bytes_received: 0,
        }
    }
pub fn open ( session_id : u32 , config : & Config , sender : MessageSender , token_manager : SharedTokensManager , session_context : SharedSessionContext , remote_services_manager : SharedRemoteServiceManager , shared_state : SharedStateMap , ) -> Self { remote_services_manager . lock ( ) . add_upstream_session ( session_id , sender . clone ( ) ) ; let registrar = remote_services_manager . lock ( ) . registrar . clone ( ) ; let id_factory = Shared :: adopt ( IdFactory :: new ( 0 ) ) ; let event_map : SharedEventMap = Shared :: default ( ) ; Session { session_id , state : SessionState :: Handshake , tracker : ObjectTracker :: default ( ) , token_manager , origin_attributes : None , message_max_time : config . general . message_max_time , services_names : enabled_services ( & config , & registrar ) , context : session_context , remote_services_manager , shared_state , session_helper : SessionSupport :: new ( SessionTrackerId :: from ( session_id , 0 ) , sender , id_factory , event_map , ) , bytes_received : 0 , } }
Creates a session for a given message sender.
Creates a session for a given message sender .
session_id
u32
config
&Config
sender
MessageSender
token_manager
SharedTokensManager
session_context
SharedSessionContext
remote_services_manager
SharedRemoteServiceManager
shared_state
SharedStateMap