我反射了半天,找到是因为System.Runtime.Remoting.Channels.RemoteConnection类的CreateNewSocket()方法,里面调用的是socket的同步连接方法,可惜这个类是internal的,没法改呀,下面是我抓Dump的相关堆栈,有点长
OS Thread Id: 0x1088 (8)
Current frame: ntdll!KiFastSystemCallRet
ChildEBP RetAddr Caller,Callee
0429e1dc 7c957d0b ntdll!NtWaitForSingleObject+0xc
0429e1e0 71a81af5 mswsock!SockWaitForSingleObject+0x19d, calling ntdll!NtWaitForSingleObject
0429e21c 71a85701 mswsock!SockDoConnectReal+0x27a, calling mswsock!SockWaitForSingleObject
0429e264 7c959f3d ntdll!RtlFreeHeap+0x126, calling ntdll!RtlGetNtGlobalFlags+0x12
0429e288 71b51510 ws2help!WahReferenceContextByHandle+0x66
0429e2ac 71a854ee mswsock!SockDoConnect+0x38a, calling mswsock!SockDoConnectReal
0429e318 79f3dc8b mscorwks!TableFreeSingleHandleToCache+0x50, calling mscorwks!DecrementMP
0429e32c 79f3dc2c mscorwks!HndDestroyHandle+0x3e, calling mscorwks!TableFreeSingleHandleToCache
0429e350 71a85365 mswsock!WSPConnect+0xbe, calling mswsock!SockDoConnect
0429e380 71b70f3f ws2_32!WSAConnect+0x5c
0429e3b4 79e95b63 mscorwks!NDirectGenericStubReturnFromCall
0429e3f0 0096a6fb 0096a6fb, calling mscorwks!NDirectGenericStubWorker
0429e41c 7a60a8f2 (MethodDesc 0x7a82d260 +0xa6 System.Net.Sockets.Socket.DoConnect(System.Net.EndPoint, System.Net.SocketAddress)), calling 7a895984
0429e43c 7a60a8f2 (MethodDesc 0x7a82d260 +0xa6 System.Net.Sockets.Socket.DoConnect(System.Net.EndPoint, System.Net.SocketAddress)), calling 7a895984
0429e468 7a601a81 (MethodDesc 0x7a82cea0 +0x55 System.Net.Sockets.Socket.Connect(System.Net.EndPoint)), calling (MethodDesc 0x7a82d260 +0 System.Net.Sockets.Socket.DoConnect(System.Net.EndPoint, System.Net.SocketAddress))
0429e47c 7a601e39 (MethodDesc 0x7a82ceb8 +0x129 System.Net.Sockets.Socket.Connect(System.Net.IPAddress[], Int32)), calling (MethodDesc 0x7a82cea0 +0 System.Net.Sockets.Socket.Connect(System.Net.EndPoint))
0429e4b0 677766d1 (MethodDesc 0x677cf2f8 +0x41 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(System.Net.Sockets.AddressFamily)), calling (MethodDesc 0x7a82ceb8 +0 System.Net.Sockets.Socket.Connect(System.Net.IPAddress[], Int32))
0429e4c4 67776601 (MethodDesc 0x677cf2e8 +0x99 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()), calling (MethodDesc 0x677cf2f8 +0 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(System.Net.Sockets.AddressFamily))
0429e4f0 67777061 (MethodDesc 0x677cf3e0 +0xf1 System.Runtime.Remoting.Channels.SocketCache.GetSocket(System.String, Boolean)), calling (MethodDesc 0x677cf2e8 +0 System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket())
0429e520 67782483 (MethodDesc 0x677d02e8 +0x103 System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransportHeaders, System.IO.Stream)), calling (MethodDesc 0x677cf3e0 +0 System.Runtime.Remoting.Channels.SocketCache.GetSocket(System.String, Boolean))
0429e550 794c5ac4 (MethodDesc 0x79249570 +0x84 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(System.IO.Stream, System.Object, System.Runtime.Remoting.Messaging.Header[], Boolean)), calling (MethodDesc 0x79252b40 +0 System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(System.Object, System.Runtime.Remoting.Messaging.Header[], System.Runtime.Serialization.Formatters.Binary.__BinaryWriter, Boolean))
0429e564 67773ab1 (MethodDesc 0x677cef80 +0x61 System.Runtime.Remoting.Channels.ChunkedMemoryStream.set_Position(Int64)), calling mscorwks!JIT_Writeable_Thunks_Buf+0x29
0429e578 6778229f (MethodDesc 0x677d02c8 +0x1b System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.AsyncProcessRequest(System.Runtime.Remoting.Channels.IClientChannelSinkStack, System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransportHeaders, System.IO.Stream)), calling (MethodDesc 0x677d02e8 +0 System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransportHeaders, System.IO.Stream))
0429e594 6778ae0e (MethodDesc 0x677d0e00 +0x92 System.Runtime.Remoting.Channels.BinaryClientFormatterSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)), calling 009875b2
0429e5d4 794bdca9 (MethodDesc 0x7926f540 +0x59 System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.AsyncProcessMessageCallback(System.Object[])), calling 009abd8a
0429e5e8 7934e6d4 (MethodDesc 0x79138258 +0x8 System.Threading.Thread.CompleteCrossContextCallback(System.Threading.InternalCrossContextDelegate, System.Object[]))
0429e5ec 79e7be1b mscorwks!CallDescrWorker+0x33
0429e5fc 79e7bd9b mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0429e67c 79f36962 mscorwks!DispatchCallBody+0x1e, calling mscorwks!CallDescrWorkerWithHandler
0429e69c 79f3690c mscorwks!DispatchCallDebuggerWrapper+0x3d, calling mscorwks!DispatchCallBody
0429e6e8 79f7691d mscorwks!Context::ValidateContext+0x81, calling mscorwks!CLRException::HandlerState::CleanupTry
0429e700 79f3699b mscorwks!DispatchCallNoEH+0x51, calling mscorwks!DispatchCallDebuggerWrapper
0429e734 79f76333 mscorwks!ThreadNative::InternalCrossContextCallback+0x20d, calling mscorwks!DispatchCallNoEH
0429e7a8 79f761a7 mscorwks!ThreadNative::InternalCrossContextCallback+0x46, calling mscorwks!LazyMachStateCaptureState
0429e7d8 7a0c724d mscorwks!CMessage::GetArgs+0x1be, calling mscorwks!PtrArray::SetAt
0429e7dc 7a0c72bc mscorwks!CMessage::GetArgs+0x22c, calling mscorwks!Frame::Pop
0429e7e0 7a0c72c4 mscorwks!CMessage::GetArgs+0x234, calling mscorwks!HelperMethodFrameRestoreState
0429e824 7a0c70ad mscorwks!CMessage::GetArgs+0x2d, calling mscorwks!LazyMachStateCaptureState
0429e884 794976ad (MethodDesc 0x7926bf40 +0xbd System.Runtime.Remoting.Channels.CrossContextChannel.get_MessageSink()), calling 79680d50
0429e8a0 794bdeeb (MethodDesc 0x7926f548 +0x233 System.Runtime.Remoting.Messaging.ClientContextTerminatorSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)), calling mscorwks!ThreadNative::InternalCrossContextCallback
0429e8e0 794bd8b9 (MethodDesc 0x79243928 +0xc1 System.Runtime.Remoting.Messaging.EnvoyTerminatorSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessageSink)), calling 009a7472
0429e8f8 794b200f (MethodDesc 0x7923e008 +0x9b System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvokeAsync(System.Runtime.Remoting.Messaging.IMessageSink, System.Runtime.Remoting.Messaging.Message, Boolean, Int32)), calling 009a745e
0429e910 794b1e98 (MethodDesc 0x7923e000 +0x338 System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage, Boolean, Int32)), calling (MethodDesc 0x7923e008 +0 System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvokeAsync(System.Runtime.Remoting.Messaging.IMessageSink, System.Runtime.Remoting.Messaging.Message, Boolean, Int32))
0429e978 794b1b4d (MethodDesc 0x7923dff8 +0x125 System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(System.Runtime.Remoting.Messaging.IMessage))
0429e998 794a98f3 (MethodDesc 0x79139ed8 +0x273 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData ByRef, Int32))
0429e9a4 79e80b32 mscorwks!HENUMInternal::ClearEnum+0x16, calling mscorwks!CStructArray::Clear
0429e9d4 79f33103 mscorwks!CTPMethodTable__CallTargetHelper3+0xf
0429e9e0 79f3309d mscorwks!CTPMethodTable::CallTarget+0xdc, calling mscorwks!CTPMethodTable__CallTargetHelper3
0429ea44 79e78686 mscorwks!GCFrame::GCFrame+0x55, calling mscorwks!GCFrame::Init
0429ea5c 79f32ff1 mscorwks!CTPMethodTable::CallTarget+0x15, calling mscorwks!CTPMethodTable::CallTarget+0x14
0429ea6c 7a1051f6 mscorwks!CTPMethodTable::OnCall+0x214, calling mscorwks!CTPMethodTable::CallTarget
0429eb04 79f40ff4 mscorwks!Thread::RareDisablePreemptiveGC+0x3c6, calling ntdll!RtlRestoreLastWin32Error
0429eba8 79e95cec mscorwks!NDirectGenericStubPostCall+0x229, calling mscorwks!_EH_epilog3
0429ebac 79e95b82 mscorwks!NDirectGenericStubReturnFromCall+0x1f, calling mscorwks!NDirectGenericStubPostCall
0429ec00 0039213d 0039213d, calling mscorwks!CTPMethodTable::OnCall
0429ec28 00ca13c6 (MethodDesc 0x9792f0 +0x56 AsyncRemotingTest.Program.AsyncInvoke(System.AsyncCallback)), calling 00979cb4
0429ec48 00ca13c6 (MethodDesc 0x9792f0 +0x56 AsyncRemotingTest.Program.AsyncInvoke(System.AsyncCallback)), calling 00979cb4
0429ec6c 79e7909f mscorwks!PreStubWorker+0x138, calling mscorwks!_EH_epilog3
0429ec70 00391efe 00391efe, calling mscorwks!PreStubWorker
0429eca8 00ca1285 (MethodDesc 0x9792e0 +0xdd AsyncRemotingTest.Program.Main(System.String[])), calling 00979380
0429ecc4 79e7909f mscorwks!PreStubWorker+0x138, calling mscorwks!_EH_epilog3
0429ecc8 00391efe 00391efe, calling mscorwks!PreStubWorker
0429ed00 79e7be1b mscorwks!CallDescrWorker+0x33
0429ed10 79e7bd9b mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0429ed90 79e7bce8 mscorwks!MethodDesc::CallDescr+0x19c, calling mscorwks!CallDescrWorkerWithHandler
0429edc0 79e7b6e8 mscorwks!MetaSig::MetaSig+0x38, calling msvcr80!memcpy [F:\SP\vctools\crt_bld\SELF_X86\crt\src\intel\memcpy.asm:101]
0429edcc 79e7bc6a mscorwks!MethodDesc::CallDescr+0xaf, calling mscorwks!ClrSafeInt<unsigned long>::addition
0429edd8 79e7bc7a mscorwks!MethodDesc::CallDescr+0xbb, calling mscorwks!_alloca_probe_16
0429ee3c 79e7871a mscorwks!CorSigEatCustomModifiers+0x1c, calling mscorwks!CorSigEatAnyVASentinel
0429ee58 79e786cd mscorwks!CorSigEatCustomModifiersAndUncompressElementType+0x19, calling mscorwks!CorSigEatCustomModifiers
0429ee74 79edbd83 mscorwks!ValidateMainMethod+0x159, calling mscorwks!CorSigEatCustomModifiersAndUncompressElementType
0429ee8c 79e7bbf2 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0429eed0 79e7bbd0 mscorwks!MethodDesc::CallTargetWorker+0x20, calling mscorwks!MethodDesc::CallDescr
0429eee8 79e802f4 mscorwks!MethodDescCallSite::CallWithValueTypes_RetArgSlot+0x18, calling mscorwks!MethodDesc::CallTargetWorker
0429eefc 79edb56e mscorwks!ClassLoader::RunMain+0x220, calling mscorwks!MethodDescCallSite::Call_RetArgSlot
0429ef8c 79f83356 mscorwks!SString::Delete+0x39, calling mscorwks!_EH_epilog3
0429f008 79e7871a mscorwks!CorSigEatCustomModifiers+0x1c, calling mscorwks!CorSigEatAnyVASentinel
0429f024 79e786cd mscorwks!CorSigEatCustomModifiersAndUncompressElementType+0x19, calling mscorwks!CorSigEatCustomModifiers
0429f040 79edbd83 mscorwks!ValidateMainMethod+0x159, calling mscorwks!CorSigEatCustomModifiersAndUncompressElementType
0429f060 79edb367 mscorwks!Assembly::ExecuteMainMethod+0xa6, calling mscorwks!ClassLoader::RunMain
0429f0d8 79e77c32 mscorwks!_EH_epilog3_GS+0xa, calling mscorwks!__security_check_cookie
0429f0dc 79e83f5a mscorwks!SString::ConvertToUnicode+0x81, calling mscorwks!_EH_epilog3_GS
0429f0f4 79e75a3a mscorwks!CLRException::HandlerState::CleanupTry+0x13, calling mscorwks!GetCurrentSEHRecord
0429f104 7c95a771 ntdll!wcslen+0x1f3, calling ntdll!RtlRestoreLastWin32Error+0x52
0429f128 7c95a90a ntdll!wcslen+0x38c, calling ntdll!RtlLeaveCriticalSection
0429f130 7c959f59 ntdll!RtlFreeHeap+0x142, calling ntdll!CIpow+0x464
0429f194 79e7b136 mscorwks!FusionBind::CompareEx+0x65, calling msvcr80!memcmp
0429f1f0 7c95ec2a ntdll!CsrClientCallServer+0x57, calling ntdll!NtRequestWaitReplyPort
0429f204 7c959f59 ntdll!RtlFreeHeap+0x142, calling ntdll!CIpow+0x464
0429f208 7c96529d ntdll!CsrFreeCaptureBuffer+0x15, calling ntdll!RtlFreeHeap
0429f21c 7c80ccd1 kernel32!SetConsoleTitleInternal+0x70, calling ntdll!CsrFreeCaptureBuffer
0429f228 7c80cceb kernel32!SetConsoleTitleInternal+0x9c, calling kernel32!__security_check_cookie
0429f274 79ea3915 mscorwks!CPropertyArray::Get+0x48, calling msvcr80!memcpy [F:\SP\vctools\crt_bld\SELF_X86\crt\src\intel\memcpy.asm:101]
0429f290 79ea38b5 mscorwks!CAssemblyName::GetProperty+0xa5, calling mscorwks!CPropertyArray::Get
0429f29c 79ea38cd mscorwks!CAssemblyName::GetProperty+0x4a, calling mscorwks!_EH_epilog3
0429f2c8 7a2d115c mscorwks!AppDomainNative::ExecuteAssemblyHelper+0x32, calling mscorwks!Assembly::ExecuteMainMethod
0429f308 7a2d2a66 mscorwks!AppDomainNative::ExecuteAssembly+0x19c, calling mscorwks!AppDomainNative::ExecuteAssemblyHelper
0429f358 7a2d28a8 mscorwks!AppDomainNative::ExecuteAssembly+0x43, calling mscorwks!LazyMachStateCaptureState
0429f498 79f42684 mscorwks!AssemblyNative::Load+0x35, calling mscorwks!LazyMachStateCaptureState
0429f554 79367db1 (MethodDesc 0x7913c278 +0x179 System.Security.Permissions.FileIOPermission.AddPathList(System.Security.Permissions.FileIOPermissionAccess, System.Security.AccessControl.AccessControlActions, System.String[], Boolean, Boolean, Boolean)), calling (MethodDesc 0x792482b8 +0 System.Security.Util.StringExpressionSet.AddExpressions(System.Collections.ArrayList, Boolean))
0429f584 79356410 (MethodDesc 0x79138c58 +0xd4 System.Reflection.Assembly.InternalLoad(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean)), calling mscorwks!AssemblyNative::Load
0429f594 7935641e (MethodDesc 0x79138c58 +0xe2 System.Reflection.Assembly.InternalLoad(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean)), calling mscorwks!DefaultMarshalOverrides<CopyMarshalerBase<unsigned short,unsigned int,0> >::DoExceptionCleanup
0429f5b8 79394a0c (MethodDesc 0x792393c0 +0x58 System.Reflection.Assembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, System.Threading.StackCrawlMark ByRef)), calling (MethodDesc 0x79138c58 +0 System.Reflection.Assembly.InternalLoad(System.Reflection.AssemblyName, System.Security.Policy.Evidence, System.Threading.StackCrawlMark ByRef, Boolean))
0429f5d4 793949a9 (MethodDesc 0x792393b0 +0x1d System.Reflection.Assembly.LoadFrom(System.String, System.Security.Policy.Evidence)), calling (MethodDesc 0x792393c0 +0 System.Reflection.Assembly.InternalLoadFrom(System.String, System.Security.Policy.Evidence, Byte[], System.Configuration.Assemblies.AssemblyHashAlgorithm, Boolean, System.Threading.StackCrawlMark ByRef))
0429f5e8 79392bf6 (MethodDesc 0x79138680 +0x32 System.AppDomain.ExecuteAssembly(System.String, System.Security.Policy.Evidence, System.String[])), calling mscorwks!AppDomainNative::ExecuteAssembly
0429f5fc 00ca114b (MethodDesc 0x973f80 +0x2b Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly())
0429f60c 793d70fb (MethodDesc 0x7924ff30 +0x3b System.Threading.ThreadHelper.ThreadStart_Context(System.Object))
0429f62c 793d70fb (MethodDesc 0x7924ff30 +0x3b System.Threading.ThreadHelper.ThreadStart_Context(System.Object))
0429f634 793608fd (MethodDesc 0x7913b948 +0x81 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object))
0429f648 793d71dc (MethodDesc 0x7924ff40 +0x40 System.Threading.ThreadHelper.ThreadStart()), calling (MethodDesc 0x7913b948 +0 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object))
0429f660 79e7be1b mscorwks!CallDescrWorker+0x33
0429f670 79e7bd9b mscorwks!CallDescrWorkerWithHandler+0xa3, calling mscorwks!CallDescrWorker
0429f6f0 79e7bce8 mscorwks!MethodDesc::CallDescr+0x19c, calling mscorwks!CallDescrWorkerWithHandler
0429f72c 79e7bc6a mscorwks!MethodDesc::CallDescr+0xaf, calling mscorwks!ClrSafeInt<unsigned long>::addition
0429f738 79e7bc7a mscorwks!MethodDesc::CallDescr+0xbb, calling mscorwks!_alloca_probe_16
0429f798 7c959f59 ntdll!RtlFreeHeap+0x142, calling ntdll!CIpow+0x464
0429f79c 79e75923 mscorwks!EEHeapFree+0x83, calling ntdll!RtlFreeHeap
0429f7a8 79e7593f mscorwks!EEHeapFree+0xa5, calling mscorwks!_EH_epilog3
0429f7d0 79e7593f mscorwks!EEHeapFree+0xa5, calling mscorwks!_EH_epilog3
0429f7d4 79e758f6 mscorwks!EEHeapFreeInProcessHeap+0x21, calling mscorwks!EEHeapFree
0429f7e8 79e7bbf2 mscorwks!MethodDesc::CallDescr+0x1f, calling mscorwks!_alloca_probe_16
0429f82c 79e7bbd0 mscorwks!MethodDesc::CallTargetWorker+0x20, calling mscorwks!MethodDesc::CallDescr
0429f844 79e802f4 mscorwks!MethodDescCallSite::CallWithValueTypes_RetArgSlot+0x18, calling mscorwks!MethodDesc::CallTargetWorker
0429f858 7a0786cb mscorwks!ThreadNative::KickOffThread_Worker+0x15d, calling mscorwks!MethodDescCallSite::Call_RetArgSlot
0429f8fc 7c95b02a ntdll!RtlImageNtHeaderEx+0x9d, calling ntdll!CIpow+0x464
0429f920 7c829433 kernel32!GetProcessVersion+0xf4, calling ntdll!RtlImageNtHeader
0429f924 7c82945f kernel32!GetProcessVersion+0x126, calling kernel32!_SEH_epilog
0429f934 7c95b02a ntdll!RtlImageNtHeaderEx+0x9d, calling ntdll!CIpow+0x464
0429f938 7c95b05c ntdll!RtlImageNtHeader+0x1b, calling ntdll!RtlImageNtHeaderEx
0429f94c 79e74106 mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0429f974 79e74106 mscorwks!ClrFlsSetValue+0x57, calling mscorwks!_EH_epilog3
0429f978 79e7412a mscorwks!DecCantStopCount+0x10, calling mscorwks!ClrFlsSetValue
0429f984 79e739cc mscorwks!CrstBase::Leave+0x96, calling mscorwks!_EH_epilog3
0429fa00 7c959f59 ntdll!RtlFreeHeap+0x142, calling ntdll!CIpow+0x464
0429fa04 79e75923 mscorwks!EEHeapFree+0x83, calling ntdll!RtlFreeHeap
0429fa10 79e7593f mscorwks!EEHeapFree+0xa5, calling mscorwks!_EH_epilog3
0429fa38 79e7593f mscorwks!EEHeapFree+0xa5, calling mscorwks!_EH_epilog3
0429fa3c 79e758f6 mscorwks!EEHeapFreeInProcessHeap+0x21, calling mscorwks!EEHeapFree
0429fa5c 79ed8a2c mscorwks!Thread::UserResumeThread+0xfb
0429fa6c 79ed89ca mscorwks!Thread::DoADCallBack+0x355, calling mscorwks!Thread::UserResumeThread+0xae
0429fb00 79ed88f1 mscorwks!Thread::DoADCallBack+0x541, calling mscorwks!Thread::DoADCallBack+0x2a5
0429fb24 7c825512 kernel32!FlsSetValue+0xc7, calling kernel32!_SEH_epilog
0429fb3c 7a0e4d96 mscorwks!Thread::DoADCallBack+0x575, calling mscorwks!Thread::DoADCallBack+0x4d4
0429fb64 7a0e4dad mscorwks!ManagedThreadBase::KickOff+0x13, calling mscorwks!Thread::DoADCallBack+0x550
0429fb78 7a07a99e mscorwks!ThreadNative::KickOffThread+0x230, calling mscorwks!ManagedThreadBase::KickOff
0429fba4 79e7593f mscorwks!EEHeapFree+0xa5, calling mscorwks!_EH_epilog3
0429fc14 79ed8e36 mscorwks!Thread::intermediateThreadProc+0x49
0429fc24 7c95ee8b ntdll!RtlAllocateActivationContextStack+0x1c2, calling ntdll!RtlLeaveCriticalSection
0429fc2c 7c95edec ntdll!RtlAllocateActivationContextStack+0x123, calling ntdll!CIpow+0x464
0429fc7c 7c95ed71 ntdll!RtlAllocateActivationContextStack+0xa8, calling ntdll!RtlActivateActivationContextUnsafeFast
0429fc80 7c95ed35 ntdll!RtlAllocateActivationContextStack+0x6c, calling ntdll!RtlDeactivateActivationContextUnsafeFast
0429fcb4 7c95edec ntdll!RtlAllocateActivationContextStack+0x123, calling ntdll!CIpow+0x464
0429fcb8 7c957c3b ntdll!ZwTestAlert+0xc
0429fcbc 7c95ecb1 ntdll!CsrClientCallServer+0xde, calling ntdll!CIpow+0x464
0429fd10 7c95ecb1 ntdll!CsrClientCallServer+0xde, calling ntdll!CIpow+0x464
0429fd14 7c956d9b ntdll!NtContinue+0xc
0429fd18 7c9584da ntdll!KiUserApcDispatcher+0x3a, calling ntdll!NtContinue
0429ffa4 79ed8e24 mscorwks!Thread::intermediateThreadProc+0x37, calling mscorwks!_alloca_probe_16
0429ffb8 7c824829 kernel32!BaseThreadStart+0x34
回答你那3个问题,
1、当然使用了异步调用呀,可是方法阻塞在begininvoke上,其实就是socket都没链接上呢,所以远程调用是还没执行呢,回调更别提了。
2、我这个测试主要就是要验证异步remoting的begininvoke和异步socket的的beginconnect方法本身会不会阻塞,所以我就是故意让物理上连接不懂,或者模拟网络质量很差的环境,比如拔掉网线,或者在手机上通过gprs来使用remoting。
3、我同时说对TcpChnal的timoute属性进行过测试,根本没用,而且从网上查资料也说是不起作用,而且没有给出解决方案,我具体没有看那个timeout的原理和实现代码呢还。
.net的socket可以设置一个setoption(sendtimeout)但这个选项只针对同步方法,对异步没用,而且我查资料说beginconnect确实有可能阻塞20秒-30秒,而且注册表里没有修改的地方,只能通过另起线程+join来自己控制超时,或者其它自定义的超时设置。
这个问题其实很严重,如果生产环境一个服务挂了,会造成其它好多服务都hang在那里,造成业务量积压等等。。
你有MSN或者其它IM联系方式吗?要不约个时间IM聊一下,谢谢