Opc.Ua.EndpointBase.GetServerForContext C# (CSharp) Method

GetServerForContext() private method

private GetServerForContext ( ) : IServerBase
return IServerBase
        protected IServerBase GetServerForContext()
        {
            // get the server associated with the host.
            IServerBase server = HostForContext.Server;

            if (server == null)
            {
                throw new ServiceResultException(StatusCodes.BadInternalError, "The endpoint is not associated with a server instance.");
            }

            // check the server status.
            if (ServiceResult.IsBad(server.ServerError))
            {
                throw new ServiceResultException(server.ServerError);
            }

            return server;
        }
        #endregion