WCF SingleTon问题 [英] WCF SingleTon Problem

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

问题描述

大家好,

我们需要在应用程序中拥有在线用户,

我使用InstanceContextMode = System.ServiceModel.InstanceContextMode.Single

每当用户登录和注销时,我都会保存他的姓名和回叫

在词典集合中,但是当用户数超过
时,我遇到了疯狂的问题
20,服务进入故障状态,

我将MaxConnection,maxConcurrentCalls,maxConcurrentSessions和maxConcurrentInstances设置为等于1000,

但这没有帮助.

请帮助我,

hello everyone,

we need to have online users in our application,

i use InstanceContextMode = System.ServiceModel.InstanceContextMode.Single

and whenever user login and logout ,i save his name and callback

in dictionary collection ,but i have crazy problem , when user count are more than

20 ,service going to fault state,

i set MaxConnection,maxConcurrentCalls,maxConcurrentSessions and maxConcurrentInstances equal to 1000,

but it isn''t helpful.

please help me,

推荐答案

请在WCF中使用跟踪来解决您的问题.
从您的描述很难理解引擎盖下发生了什么.
作为一个问题,我想这可能是一些内存泄漏问题.

因此,在WCF中包括跟踪,并仔细检查吧!.

Please use tracing in WCF to rack your problem.
From your description is very hard to understand what happened under the hood.
As an issue i suppose it could be some memory leak problem.

So include tracing in your WCF , and look throuht it!.

<system.diagnostics>
		<sources>
			<source name="System.ServiceModel" switchvalue="Information, Critical, Error">
							propagateActivity="true">
				<listeners>
					<add name="log" />
				</listeners>
			</source>
			<source name="System.ServiceModel.MessageLoging" switchvalue="Critical">
				<listeners>
					<add name="log" />
				</listeners>
			</source>
		</sources>
		<sharedlisteners>
			<add name="log" type="System.Diagnostics.XmlWriterTraceListener">
			initializeData="Traces.svclog" />
		</add></sharedlisteners>
		<trace autoflush="true" />
	</system.diagnostics>




还有,您出于什么目的设置maxConcurrentInstances?我猜想,它应该只有一个...




And one more, for what purpose you set maxConcurrentInstances ?? As i suppose , it should be only one...


这篇关于WCF SingleTon问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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