c# - How to get the number of open/faulted channels for a WCF service? -


i know can use servicethrottlingbehavior set how many concurrent sessions i'd service support in order come best values i'm trying find out what's being used @ different hours of day. i'd expose service method return live data or in minimal case, log it.

is there way in wcf service see how many channels open and/or in faulted state?

after "open" web service, program or windows service (however running it) should execute loop monitors status of connections. if connection faults, instance, program running web service not know fault unless query system.servicemodel.communicationstate(repeatedly).

  'execution stops here loop through , check status of host services   while true       ii = 0 - 1  'i = count of started web services, -1 0 index offset          'check broken connection case          if objservicehost(ii).state <> communicationstate.opened             throw new exception("synchronizationws service host failed.")              exit while          end if       next       threading.thread.sleep(1000) 'sleep 1 second before going trying next   end while 

you might try this.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -