SHARE
TWEET

Untitled

a guest Feb 19th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NetTcpBinding netBind = new NetTcpBinding();
  2. netBind.Security.Mode = SecurityMode.Transport;
  3. netBind.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
  4. netBind.MaxReceivedMessageSize = Int32.MaxValue;
  5. netBind.MaxBufferSize = Int32.MaxValue;
  6. netBind.MaxBufferPoolSize = 0;
  7. netBind.MaxConnections = 300;
  8. netBind.ListenBacklog = 300;
  9. netBind.ReaderQuotas = XmlDictionaryReaderQuotas.Max;
  10. netBind.PortSharingEnabled = true;
  11. netBind.OpenTimeout = new TimeSpan(0, 0, RegistryValues.DatabaseTimeout);
  12. netBind.CloseTimeout = new TimeSpan(0, 0, RegistryValues.DatabaseTimeout);
  13. netBind.ReceiveTimeout = new TimeSpan(0, 5, 0);
  14. netBind.SendTimeout = new TimeSpan(0, 5, 0);
  15. netBind.ReliableSession.InactivityTimeout = new TimeSpan(long.MaxValue);
  16. netBind.TransferMode = TransferMode.Buffered;
  17. uriBuilder = new UriBuilder("net.tcp", connServer, (connPort == -1 ? RegistryValues.ServerPort : connPort), "Data");
  18. epAddress = new EndpointAddress(uriBuilder.Uri);
  19. ChannelFactory<IData> iChannel = new ChannelFactory<IData>(netBind, epAddress);
  20. iChannel.Credentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Identification;
  21. IData svcCon = iChannel.CreateChannel();
  22. ((IClientChannel)svcCon).OperationTimeout = new TimeSpan(long.MaxValue);
  23.      
  24. public void Dispose()
  25. {
  26.     if (this != null && this.connection.State == ConnectionState.Open)
  27.         ClearConnectionPool();
  28.  
  29.     try
  30.     {
  31.         if (iChannel.State != CommunicationState.Faulted)
  32.             iChannel.Close();
  33.     }
  34.     catch { iChannel.Abort(); }
  35.  
  36.     try
  37.     {
  38.         if (((IClientChannel)svcCon).State != CommunicationState.Faulted)
  39.             ((IClientChannel)svcCon).Close();
  40.     }
  41.     catch { ((IClientChannel)svcCon).Abort(); }
  42. }
  43.      
  44. A first chance exception of type 'System.OutOfMemoryException' occurred in SMDiagnostics.dll
  45. A first chance exception of type 'System.InsufficientMemoryException' occurred in SMDiagnostics.dll
  46. A first chance exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
  47. Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.MessageRpc.Process'
  48. A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll
  49. Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump'
  50. A first chance exception of type 'System.IO.IOException' occurred in System.dll
  51. Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest'
  52. Step into: Stepping over method without symbols 'System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump'
  53. A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in System.ServiceModel.dll
  54. Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
  55. Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
  56. A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll
  57. Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
  58. Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
  59. A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
  60. Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.AsyncThunk.UnhandledExceptionFrame'
  61. Step into: Stepping over method without symbols 'System.Net.LazyAsyncResult.Complete'
  62. A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in mscorlib.dll
  63. Step into: Stepping over method without symbols 'System.Net.Security.NegotiateStream.ProcessFrameBody'
  64. A first chance exception of type 'System.ServiceModel.CommunicationObjectFaultedException' occurred in System.ServiceModel.dll
  65. Step into: Stepping over method without symbols 'System.Net.Security.NegotiateStream.ReadCallback'
  66. Step into: Stepping over method without symbols 'System.Net.FixedSizeReader.CheckCompletionBeforeNextRead'
  67. Step into: Stepping over method without symbols 'System.Net.FixedSizeReader.ReadCallback'
  68. Step into: Stepping over method without symbols 'System.ServiceModel.AsyncResult.Complete'
  69. Step into: Stepping over method without symbols 'System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame'
  70. Step into: Stepping over method without symbols 'System.Threading._IOCompletionCallback.PerformIOCompletionCallback'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top