Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NetTcpBinding netBind = new NetTcpBinding();
- netBind.Security.Mode = SecurityMode.Transport;
- netBind.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
- netBind.MaxReceivedMessageSize = Int32.MaxValue;
- netBind.MaxBufferSize = Int32.MaxValue;
- netBind.MaxBufferPoolSize = 0;
- netBind.MaxConnections = 300;
- netBind.ListenBacklog = 300;
- netBind.ReaderQuotas = XmlDictionaryReaderQuotas.Max;
- netBind.PortSharingEnabled = true;
- netBind.OpenTimeout = new TimeSpan(0, 0, RegistryValues.DatabaseTimeout);
- netBind.CloseTimeout = new TimeSpan(0, 0, RegistryValues.DatabaseTimeout);
- netBind.ReceiveTimeout = new TimeSpan(0, 5, 0);
- netBind.SendTimeout = new TimeSpan(0, 5, 0);
- netBind.ReliableSession.InactivityTimeout = new TimeSpan(long.MaxValue);
- netBind.TransferMode = TransferMode.Buffered;
- uriBuilder = new UriBuilder("net.tcp", connServer, (connPort == -1 ? RegistryValues.ServerPort : connPort), "Data");
- epAddress = new EndpointAddress(uriBuilder.Uri);
- ChannelFactory<IData> iChannel = new ChannelFactory<IData>(netBind, epAddress);
- iChannel.Credentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Identification;
- IData svcCon = iChannel.CreateChannel();
- ((IClientChannel)svcCon).OperationTimeout = new TimeSpan(long.MaxValue);
- public void Dispose()
- {
- if (this != null && this.connection.State == ConnectionState.Open)
- ClearConnectionPool();
- try
- {
- if (iChannel.State != CommunicationState.Faulted)
- iChannel.Close();
- }
- catch { iChannel.Abort(); }
- try
- {
- if (((IClientChannel)svcCon).State != CommunicationState.Faulted)
- ((IClientChannel)svcCon).Close();
- }
- catch { ((IClientChannel)svcCon).Abort(); }
- }
- A first chance exception of type 'System.OutOfMemoryException' occurred in SMDiagnostics.dll
- A first chance exception of type 'System.InsufficientMemoryException' occurred in SMDiagnostics.dll
- A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.MessageRpc.Process'
- A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump'
- A first chance exception of type 'System.IO.IOException' occurred in System.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest'
- Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump'
- A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
- Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
- A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
- Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
- A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
- Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
- Step into: Stepping over method without symbols 'System.Net.LazyAsyncResult.Complete'
- A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in mscorlib.dll
- Step into: Stepping over method without symbols 'System.Net.Security.NegotiateStream.ProcessFrameBody'
- A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
- Step into: Stepping over method without symbols 'System.Net.Security.NegotiateStream.ReadCallback'
- Step into: Stepping over method without symbols 'System.Net.FixedSizeReader.CheckCompletionBeforeNextRead'
- Step into: Stepping over method without symbols 'System.Net.FixedSizeReader.ReadCallback'
- Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
- Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame'
- Step into: Stepping over method without symbols 'System.Threading._IOCompletionCallback.PerformIOCompletionCallback'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement