Anyone know what would cause this exception and what handle it is talking about.
I am just calling the Socket BeginConnect method. It doens't occur all the time it just appeared randomly.
ipepServer = new IPEndPoint(server, port);
System.ApplicationException: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)) at System.Threading.ThreadPool.BindIOCompletionCallbackNative(IntPtr fileHandle) at System.Threading.ThreadPool.BindHandle(SafeHandle osHandle) at System.Net.Sockets.Socket.BindToCompletionPort() at System.Net.Sockets.BaseOverlappedAsyncResult.SetUnmanagedStructures(Object objectsToPin) at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state) at System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state)
What was happending is that a COM object in the same process using window sockets would call close on the same handle more then once.
So what was happending I assume is the COM object would use a handle, close it, dotnet would some how create a new connection and get the same handle value, then the COM object would call close on the old handle.
Tuesday, January 29, 2008 4:25 PM
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.