public void RegisterSessionHandlerFactory(IMessageSessionHandlerFactory factory, SessionHandlerOptions options)
        {
            IMessageSessionAsyncHandlerFactory messageSessionAsyncHandlerFactory = MessageSessionHandlerFactory.Create(factory);

            MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, messageSessionAsyncHandlerFactory, options, null, null);
            registerSessionHandlerFactoryAsyncResult.RunSynchronously();
        }
        public Task RegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory factory, SessionHandlerOptions options)
        {
            IMessageSessionAsyncHandlerFactory messageSessionAsyncHandlerFactory = MessageSessionHandlerFactory.Create(factory);

            return(TaskHelpers.CreateTask((AsyncCallback c, object s) => this.BeginRegisterSessionHandler(messageSessionAsyncHandlerFactory, options, c, s), (IAsyncResult r) => this.EndRegisterSessionHandler(r)));
        }
 public SyncFactoryAdapter(IMessageSessionHandlerFactory syncFactory)
 {
     this.syncFactory = syncFactory;
 }
 public static IMessageSessionAsyncHandlerFactory Create(IMessageSessionHandlerFactory factory)
 {
     return(new MessageSessionHandlerFactory.SyncFactoryAdapter(factory));
 }