2つのメソッドでサービスを公開するWCFnet.tcpサーバーがあります。
string Get(location);
void Put(location);
maxConnections
に設定されint.MaxValue
ます。クライアント側でmaxConnections
は、800に設定されています。サーバーで例外は発生しません
クライアントアプリケーションがあり、100以上のスレッドが作成されることがあり、各スレッドはいつでもサーバーに接続できます。
スレッドがコネクタクラスを共有している場合、アプリは正常に動作します。各スレッドに独自のコネクタを作成させる場合、20〜30のスレッドを使用すると、各スレッドは正常に機能します。しかし、アプリが50以上のスレッドを作成すると、すべての接続が突然タイムアウトし始めます。
System.TimeoutException: The open operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The socket transfer timed out after 00:01:00. You have exceeded the timeou
t set on your binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected
host has failed to respond
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at MySource.Get(String account)
at MyService.Get(String account) in d:\Users\menkaur\Documents\Expression\Blend 4\Projects\Service References\MySourceService\Reference.cs:line 99
at auto_liker_bot.Program.<>c__DisplayClass58.<>c__DisplayClass60.<Main>b__4c(IMySource _mySource) in d:\Users\menkaur\Documents\Expression\Blend 4\Projects\my-project\Program.cs:line 473
at auto_liker_bot.Program.PerformAction(UInt64 threadId, IMySource& mySource, Action`1 action) in d:\Users\menkaur\Documents\Expression\Blend 4\Projects\my-project\Program.cs:line 919
WCFクラスでそのようなことが起こっていることに気付いたのはこれが初めてではありません。
これはWCFの厳しい制限ですか、それともこの動作を取り除くために変更できる設定がありますか?