예제 #1
0
 public LocalSession(LocalServer server, SessionInfo sessionInfo, IRemoteServerSession session) : base()
 {
     _server          = server;
     _session         = session;
     _sessionInfo     = sessionInfo;
     _sessionID       = session.SessionID;
     _internalSession = ((IServer)_server._internalServer).Connect(new SessionInfo(Engine.SystemUserID, String.Empty, Engine.SystemLibraryName, false));
     StartKeepAlive();
 }
예제 #2
0
        /// <summary>
        ///     Connects to the server using the given parameters and returns an interface to the connection.
        ///     Will raise if the server is not running.
        /// </summary>
        /// <param name='sessionInfo'>A <see cref="SessionInfo"/> object describing session configuration information for the connection request.</param>
        /// <returns>An <see cref="IServerSession"/> interface to the open session.</returns>
        public IServerSession Connect(SessionInfo sessionInfo)
        {
            if ((sessionInfo.HostName == null) || (sessionInfo.HostName == ""))
            {
                sessionInfo.HostName = _hostName;
            }
            sessionInfo.CatalogCacheName = _internalServer.Name;
            IRemoteServerSession session = _serverConnection.Connect(sessionInfo);

            return(new LocalSession(this, sessionInfo, session));
        }
 // IRemoteServer.Disconnect
 public void Disconnect(IRemoteServerSession session)
 {
     BeginCall();
     try
     {
         RemoteServerSession localSession = session as RemoteServerSession;
         if (session != null)
         {
             localSession.Dispose();
         }
     }
     finally
     {
         EndCall();
     }
 }
예제 #4
0
 public void Disconnect(IRemoteServerSession session)
 {
     try
     {
         var          channel = GetServiceInterface();
         IAsyncResult result  = channel.BeginDisconnect(((ClientSession)session).SessionHandle, null, null);
         result.AsyncWaitHandle.WaitOne();
         channel.EndDisconnect(result);
     }
     catch (FaultException <DataphorFault> fault)
     {
         throw DataphorFaultUtility.FaultToException(fault.Detail);
     }
     catch (CommunicationException ce)
     {
         ReportCommunicationError();
         throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce);
     }
 }