如何解决mongoDB 2.0中的套接字连接错误?

时间:2018-12-06 05:24:54

标签: c# mongodb mongodb-.net-driver

MongoDB.Driver.MongoConnectionException:从服务器接收消息时发生异常。 ---> System.IO.IOException:无法从传输连接中读取数据:连接尝试失败,因为一段时间后被连接方未正确响应,或者由于连接的主机未能响应而建立的连接失败。 ---> System.Net.Sockets.SocketException:连接尝试失败,因为一段时间后连接方未正确响应,或者由于连接的主机未能响应,所以建立的连接失败 在System.Net.Sockets.Socket.Receive(Byte []缓冲区,Int32偏移量,Int32大小,SocketFlags socketFlags) 在System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小) ---内部异常堆栈跟踪的结尾--- 在System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小) 在System.Net.FixedSizeReader.ReadPacket(Byte []缓冲区,Int32偏移量,Int32计数) 在System.Net.Security._SslStream.StartFrameHeader处(字节[]缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest) 在System.Net.Security._SslStream.StartReading(Byte []缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest) 在System.Net.Security._SslStream.ProcessRead(Byte []缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest) 在System.Net.Security.SslStream.Read处(字节[]缓冲区,Int32偏移量,Int32计数) 在MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytes(流流,Byte []缓冲区,Int32偏移量,Int32计数,CancellationToken cancelledToken) 在MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer()处 ---内部异常堆栈跟踪的结尾--- 在MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer()处 在MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBuffer(Int32 responseTo,CancellationToken cancelledToken) 在MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessage(Int32 responseTo,IMessageEncoderSelector encoderSelector,MessageEncoderSettings messageEncoderSettings,CancellationToken cancelledToken处) 在MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquiredConnection.ReceiveMessage(Int32 responseTo,IMessageEncoderSelector encoderSelector,MessageEncoderSettings messageEncoderSettings,CancellationToken cancelledToken处) 在MongoDB.Driver.Core.WireProtocol.CommandWireProtocol 1.Execute(IConnection connection, CancellationToken cancellationToken) at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol 1协议上,使用CancellationToken cancelToken) 在MongoDB.Driver.Core.Servers.Server.ServerChannel.Command [TResult]处(ICoreSession会话,ReadPreference readPreference,DatabaseNamespace databaseNamespace,BsonDocument命令,IElementNameValidator命令Validator,BsonDocument AdditionalOptions,Func 1 responseHandling, Boolean slaveOk, IBsonSerializer 1 resultSerializer,MessageEncoderSettings messageEncoderSettings,CancellationToken ) 在MongoDB.Driver.Core.Operations.RetryableWriteCommandOperationBase.ExecuteAttempt(RetryableWriteContext上下文,Int32尝试,Nullable 1 transactionNumber, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.RetryableWriteOperationExecutor.Execute[TResult](IRetryableWriteOperation 1操作,RetryableWriteContext上下文,CancellationToken cancelledToken) 位于MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase 1.ExecuteBatches(RetryableWriteContext context, CancellationToken cancellationToken) at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase 1.Execute(RetryableWriteContext上下文,CancellationToken cancelledToken)处 在MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteBatch(RetryableWriteContext上下文,批处理批次,CancellationToken cancelledToken) 在MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.Execute(IWriteBinding绑定,CancellationToken cancelledToken) 在MongoDB.Driver.OperationExecutor.ExecuteWriteOperation [TResult](IWriteBinding绑定,IWriteOperation 1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl 1.ExecuteWriteOperation [TResult](IClientSessionHandle会话,IWriteOperation 1 operation, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl 1.BulkWrite(IClientSessionHandle会话,IEnumerable {1} 1。<> c__DisplayClass23_0.b__0(IClientSessionHandle会话) 位于MongoDB.Driver.MongoCollectionImpl 1 requests, BulkWriteOptions options, CancellationToken cancellationToken) at MongoDB.Driver.MongoCollectionImpl 2 func,CancelationToken cancelToken处) 在MongoDB.Driver.MongoCollectionImpl 1.UsingImplicitSession[TResult](Func 1个请求中,BulkWriteOptions选项,CancellationToken cancelledToken) 在MongoDB.Driver.MongoCollectionBase 1.BulkWrite(IEnumerable 1个请求中,BulkWriteOptions bulkWriteOptions) 在MongoDB.Driver.MongoCollectionBase 1.<>c__DisplayClass58_0.b__0(IEnumerable 2 bulkWrite处) 在MongoDB.Driver.MongoCollectionBase`1.InsertOne(TDocument文档,InsertOneOptions选项,CancellationToken cancelledToken)

0 个答案:

没有答案