Exemple #1
0
        /// <summary>
        /// Connects to an existing IPC connection.
        /// </summary>
        /// <remarks>
        /// To set up such a connection, call <see cref="InitializeInterDomainConnection"/> in the remote application domain.
        /// </remarks>
        /// <param name="channelUrl"></param>
        internal void ConnectInterDomainConnection(string channelUrl)
        {
            var endPointConfig = EndPointConfigurationData <DomainConnectionEndPoint> .InitializeDefault();

            var duplexChannel = new DomainChannel(endPointConfig, channelUrl);

            duplexChannel.InitializeConnection(OnDomainConnected);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new IPC connection which has a <see cref="DomainConnectionEndPoint"/> on both connection sides.
        /// </summary>
        /// <remarks>
        /// To connect to the created connection,
        /// call <see cref="ConnectInterDomainConnection"/> in the remote application domain using the returned value.
        /// </remarks>
        /// <returns>The url of the created IPC channel.</returns>
        internal string InitializeInterDomainConnection()
        {
            var endPointConfig = EndPointConfigurationData <DomainConnectionEndPoint> .InitializeDefault();

            var duplexChannel = new DomainChannel(endPointConfig);

            duplexChannel.InitializeConnection(OnDomainConnected);
            return(duplexChannel.LocalEndPointUrl);
        }
Exemple #3
0
        /// <summary>
        /// Creates or opens a connection to an instance of <typeparamref name="TEndPoint"/>.
        /// </summary>
        /// <typeparam name="TEndPoint">The type of the endpoint to create or open.</typeparam>
        /// <returns>The url to the endpoint of the connection.</returns>
        internal string CreateChannel <TEndPoint>()
            where TEndPoint : EndPointObject
        {
            var endPointConfig = EndPointConfigurationData <TEndPoint> .InitializeDefault();

            var channel = new SimplexChannel <TEndPoint>(endPointConfig);

            channel.InitializeChannel();
            return(channel.EndPointUrl);
            // ToDo: Testing required, need to save reference to the channel?
        }