ReplyHandler.cs 639 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.ServiceModel.Channels;
  6. using System.ServiceModel;
  7. namespace System.ServiceModel.Dispatcher
  8. {
  9. internal class ReplyHandler : BaseRequestProcessorHandler
  10. {
  11. IDuplexChannel duplex;
  12. public ReplyHandler (IChannel channel)
  13. {
  14. duplex = channel as IDuplexChannel;
  15. }
  16. protected override bool ProcessRequest (MessageProcessingContext mrc)
  17. {
  18. // if IsOneWay then no need to handle reply
  19. if (mrc.Operation.IsOneWay)
  20. return false;
  21. if (duplex != null)
  22. mrc.Reply (duplex, true);
  23. else
  24. mrc.Reply (true);
  25. return false;
  26. }
  27. }
  28. }
  29. */