Hi,
I'm creating a control that will be hosted in internet explorer and use
remoting to communicate with a server application.
The remoting object is a single call server activated object. When
then control is hosted in IE, the first remoting call takes 100 sec to
complete. Subsequent call are extremely quick. When the control is
run as a windows application, there is no delay.
I have trace the problem to ConfigurationSettings.GetConfig() which
eventually calls System.Threading.WaitHandle.WaitOne(). This
presumably times out, and then things continue. A copy of the
callstack is provided below.
I have seen numerous other posts that suggest using
System.Configuration.ConfigurationSettings.GetConfig("DNS");
or System.Configuration.ConfigurationSettings.GetConfig("foo");
or System.Configuration.ConfigurationSettings.GetConfig("magic");
before accessing my remoting calls. Unfortunately these calls also
result in ConfigurationSettings.GetConfig() being called and the 100
sec delay occurs. Other calls such as System.Net.Dns.Resolve() also
have the same delay.
I noticed in the call stack that a HttpWebRequest.GetResponse is
called. I can't see any HTTP request with a packet sniffer or in the
IIS logs.
I am using XP with SP2, IE 6.0, .Net Framework 1.1
Any suggestions? I am really stumped.
- Greg
The callstack is as follows:
00000000()
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int
millisecondsTimeout, bool exitContext) + 0x59 bytes
system.dll!System.Net.HttpWebRequest.GetResponse() + 0x91 bytes
system.dll!System.Net.WebClient.OpenRead(string address) + 0x54
bytes
system.dll!System.Configuration.ConfigurationRecord.OpenXmlTextReader(string
configFileName) + 0x146 bytes
system.dll!System.Configuration.ConfigurationRecord.Load(string
filename) + 0x87 bytes
system.dll!System.Configuration.DefaultConfigurationSystem.System.Configuration.IConfigurationSystem.Init()
+ 0x12f bytes
system.dll!System.Configuration.ConfigurationSettings.SetConfigurationSystem(System.Configuration.IConfigurationSystem
configSystem) + 0x5c bytes
system.dll!System.Configuration.ConfigurationSettings.GetConfig(string
sectionName) + 0x80 bytes
system.dll!System.Net.Sockets.Socket.InitializeSockets() + 0x2c6
bytes
system.dll!System.Net.Sockets.Socket..cctor() + 0x6 bytes
system.dll!System.Net.Dns..cctor() + 0x2f bytes
system.runtime.remoting.dll!System.Runtime.Remoting.Channels.RemoteConnection.RemoteConnection(System.Runtime.Remoting.Channels.SocketCache
socketCache = {System.Runtime.Remoting.Channels.SocketCache}, string
machineAndPort = "weitbynb130:1003") + 0xe8 bytes
system.runtime.remoting.dll!System.Runtime.Remoting.Channels.SocketCache.GetSocket(string
machineAndPort = "weitbynb130:1003") + 0x6b bytes
system.runtime.remoting.dll!System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(System.Runtime.Remoting.Messaging.IMessage
msg = {System.Runtime.Remoting.Messaging.Message},
System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders =
{System.Runtime.Remoting.Channels.BaseTransportHeaders},
System.IO.Stream requestStream =
{System.Runtime.Remoting.Channels.ChunkedMemoryStream}) + 0x88 bytes
system.runtime.remoting.dll!System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(System.Runtime.Remoting.Messaging.IMessage
msg = {System.Runtime.Remoting.Messaging.Message},
System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders =
{System.Runtime.Remoting.Channels.BaseTransportHeaders},
System.IO.Stream requestStream =
{System.Runtime.Remoting.Channels.ChunkedMemoryStream},
System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders =
<undefined value>, System.IO.Stream responseStream = <undefined value>)
+ 0x21 bytes
system.runtime.remoting.dll!System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage
msg = {System.Runtime.Remoting.Messaging.Message}) + 0x83 bytes
mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink
ms, System.Runtime.Remoting.Messaging.IMessage reqMsg,
System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks,
System.Threading.Thread currentThread,
System.Runtime.Remoting.Contexts.Context currentContext, bool
bSkippingContextChain) + 0x62 bytes
mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage
reqMcmMsg, bool useDispatchMessage, int callType) + 0x28d bytes
mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage
reqMsg) + 0x113 bytes
mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData
msgData, int type) + 0x288 bytes
[quoted text, click to view] > delaytest.exe!DelayTest.ClientControl.Send(string sMsg = "TestMsg") Line 165 C#