public void RegisterSessionHandler(Type handlerType, SessionHandlerOptions options)
        {
            IMessageSessionAsyncHandlerFactory messageSessionAsyncHandlerFactory = MessageSessionHandlerFactory.Create(handlerType);

            MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, messageSessionAsyncHandlerFactory, options, null, null);
            registerSessionHandlerFactoryAsyncResult.RunSynchronously();
        }
 public void RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options)
 {
     MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult registerSessionHandlerFactoryAsyncResult = new MessageSessionPumpHost.RegisterSessionHandlerFactoryAsyncResult(this, factory, options, null, null);
     registerSessionHandlerFactoryAsyncResult.RunSynchronously();
 }