我开发了一个接收短信的短信服务器,分析它们并回复消息。此应用程序使用 Entity Framework 4.0 和 SQLServer 2008 开发。
当我收到短信时,我会为该消息运行新线程并分析和响应消息。每个线程都有自己的对象上下文的新实例,所有线程在 SQL Server 中调用相同的存储过程。
但是当大量 SMS 到达服务器并且线程数量增加时,我每次都会收到以下两个错误之一:
The underlying provider failed on Open. A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (Provider: TCP Provider, error: 0 - The specified network name is no longer available.)
或者
The underlying provider failed on Open. A connection was successfully established with the server, but then an error occurred during the login process. (Provider: TCP Provider, error: 0 - The specified network name is no longer available.)
我将最大池大小和连接超时增加到 400 和 150。
谁能帮我??
谢谢
最佳答案
您可以尝试增加 SQL Server 中的超时设置。默认值为 10 分钟。
http://msdn.microsoft.com/en-us/library/ms189040(v=sql.105).aspx
关于sql-server - 与服务器成功建立连接,但随后在登录前握手/登录过程中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4290229/