在获取现有WCF连接数 [英] Getting the number of existing connections in WCF

查看:793
本文介绍了在获取现有WCF连接数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以检查现有的可用连接WCF服务有多少?编程?

我想看看到Web服务连接都在ASP.NET code正确关闭。
谢谢


解决方案

您可以检查出类似<一个href=\"http://blogs.technet.com/appfabric/archive/2010/01/20/monitoring-applications-using-windows-server-appfabric.aspx\"相对=nofollow>的Windows Server AppFabric的用于这一目的。

在WCF中,大部分时间,连接是唯一的开放很简单呢 - 只要拨打服务电话持续。所以你不能真的去检查,如果周围有任何连接 - 他们将消失在呼叫终止

您还可以查看到 WCF性能计数器可用在服务器端,以保持并发会话数的眼睛。你绝对可以查询从.NET code性能计数器。该服务性能计数器例如提供一个数字,在任何给定时间内存实例(服务类) - 这是在任何特定时间被处理的请求数量(这可能是你可以称之为一个连接WCF服务)

Is it possible to check the number of existing available connections a wcf service has? programmatically?

I want to see if connections to the web service were closed properly in the ASP.NET code. thanks

解决方案

You could check out something like Windows Server AppFabric for that purpose.

In WCF, most of the time, the "connections" are only open very briefly anyway - for as long as a service call lasts. So you can't really go check if there are any connections around - they'll be gone when the call terminates.

You can also check into the WCF performance counters that are available on the server side to keep an eye on the number of concurrent sessions. You can definitely query performance counters from .NET code. The Service Performance Counters offer e.g. a number of instances (of your service class) that are in memory at any given time - that's the number of requests being handled at any given time (which is probably what you could call a "connection" to a WCF service).

这篇关于在获取现有WCF连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆