Opc.Ua.Client.Session.Open C# (CSharp) Method

Open() public method

Establishes a session with the server.
public Open ( string sessionName, uint sessionTimeout, IUserIdentity identity, IList preferredLocales ) : void
sessionName string The name to assign to the session.
sessionTimeout uint The session timeout.
identity IUserIdentity The user identity.
preferredLocales IList The list of preferred locales.
return void
        public void Open(
            string sessionName,
            uint sessionTimeout,
            IUserIdentity identity,
            IList<string> preferredLocales)
        {
            Open(sessionName, sessionTimeout, identity, preferredLocales, true);
        }

Same methods

Session::Open ( string sessionName, IUserIdentity identity ) : void
Session::Open ( string sessionName, uint sessionTimeout, IUserIdentity identity, IList preferredLocales, bool checkDomain ) : void

Usage Example

コード例 #1
0
ファイル: MainForm.cs プロジェクト: OPCFoundation/UA-.NET
        /// <summary>
        /// Creates a new session.
        /// </summary>
        private Session CreateSession()
        {
            try
            {
                Cursor = Cursors.WaitCursor;

                ServiceMessageContext messageContext = m_configuration.CreateMessageContext();
                BindingFactory bindingFactory = BindingFactory.Create(m_configuration, messageContext);

                ConfiguredEndpoint endpoint = this.EndpointsCTRL.SelectedEndpoint;
                
                endpoint.UpdateFromServer(bindingFactory);
                                
                // Initialize the channel which will be created with the server.
                ITransportChannel channel = SessionChannel.Create(
                    m_configuration,
                    endpoint.Description,
                    endpoint.Configuration,
                    m_configuration.SecurityConfiguration.ApplicationCertificate.Find(true),
                    messageContext);

                // Wrap the channel with the session object.
                Session session = new Session(channel, m_configuration, endpoint, null);

                // Create the session. This actually connects to the server.
                session.Open(Guid.NewGuid().ToString(), null);

                return session;
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
All Usage Examples Of Opc.Ua.Client.Session::Open