Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="port"></param>
        /// <param name="sertificateFilename"></param>
        /// <param name="sertificatePassword"></param>
        /// <param name="handler"></param>
        /// <param name="channels"></param>
        public LrpAcceptor(int port, string sertificateFilename, string sertificatePassword, ILrpServerHandler handler, LrpChannelsPool channels)
        {
            if (handler == null)
                throw new ArgumentNullException(nameof(handler));

            if (sertificateFilename == null)
                sertificateFilename = string.Empty;

            if (sertificatePassword == null)
                sertificatePassword = string.Empty;

            this.handler = handler;
            this.handle = GCHandle.Alloc(this);
            var handle = new LPtr(GCHandle.ToIntPtr(this.handle));

            try
            {
                this.proxy = new LocalServerProxy(Native.Client, channels.Handle, port, sertificateFilename, sertificatePassword, handle);
            }
            catch
            {
                this.handle.Free();
                throw;
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="port"></param>
        /// <param name="sertificateFilename"></param>
        /// <param name="sertificatePassword"></param>
        /// <param name="handler"></param>
        /// <param name="channels"></param>
        public LrpAcceptor(int port, string sertificateFilename, string sertificatePassword, ILrpServerHandler handler, LrpChannelsPool channels)
        {
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            if (sertificateFilename == null)
            {
                sertificateFilename = string.Empty;
            }

            if (sertificatePassword == null)
            {
                sertificatePassword = string.Empty;
            }

            this.handler = handler;
            this.handle  = GCHandle.Alloc(this);
            var handle = new LPtr(GCHandle.ToIntPtr(this.handle));

            try
            {
                this.proxy = new LocalServerProxy(Native.Client, channels.Handle, port, sertificateFilename, sertificatePassword, handle);
            }
            catch
            {
                this.handle.Free();
                throw;
            }
        }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="port"></param>
 /// <param name="handler"></param>
 /// <param name="channels"></param>
 public LrpAcceptor(int port, ILrpServerHandler handler, LrpChannelsPool channels)
     : this(port, null, null, handler, channels)
 {
 }
Пример #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="port"></param>
 /// <param name="handler"></param>
 /// <param name="channels"></param>
 public LrpAcceptor(int port, ILrpServerHandler handler, LrpChannelsPool channels)
     : this(port, null, null, handler, channels)
 {
 }