iocp

Calling WSAGetLastError() from an IOCP thread return incorrect result

三世轮回 提交于 2019-11-30 08:31:46
问题 I have called WSARecv() which returned WSA_IO_PENDING . I have then sent an RST packet from the other end. The GetQueuedCompletionStatus() function which exists in another thread has returned FALSE as expected, but when I called WSAGetLastError() I got 64 instead of WSAECONNRESET . So why WSAGetLastError() did not return WSAECONNRESET ? Edit: I forgot to mention that when I call WSAGetLastError() directly after a failing WSARecv() (because of an RST packet being received), the error code

Visual C++ program crashed, but no dumpfile generated. why?

二次信任 提交于 2019-11-29 11:33:44
I have a very strange situation. I'm running IOCP Server Program programmed by Visual studio 2010 in C++. It uses 'minidump', so When there is a logical bug like pointer misuse, Program crashes with dump file so I can find out where is the crash point in codes. Sometimes (very rarely), the program crashes and there are no dump files. What situation makes SetUnhandledExceptionFilter() not working? Anybody knows this problem? I can't figure out. Well, of course you don't know because you don't have a minidump to look at. You should do the absolute minimum when the SetUnhandledExceptionFilter

Calling WSAGetLastError() from an IOCP thread return incorrect result

断了今生、忘了曾经 提交于 2019-11-29 06:55:54
I have called WSARecv() which returned WSA_IO_PENDING . I have then sent an RST packet from the other end. The GetQueuedCompletionStatus() function which exists in another thread has returned FALSE as expected, but when I called WSAGetLastError() I got 64 instead of WSAECONNRESET . So why WSAGetLastError() did not return WSAECONNRESET ? Edit: I forgot to mention that when I call WSAGetLastError() directly after a failing WSARecv() (because of an RST packet being received), the error code returned is WSAECONNRESET and not 64 . So it looks like the error code returned depends on whether WSARecv(

I/O completion port's advantages and disadvantages

天涯浪子 提交于 2019-11-28 03:06:15
Why do many people say I/O completion port is fast and nice model? What is the I/O completion port's advantages and disadvantages? I want to know some points which make faster IOCP than other model. If you can explain it comparing other models(select, epoll, traditional multi thread/process), it would be better. Damon I/O completion ports are awesome. There's no better word to describe them. If anything in Windows was done right, it's completion ports. You can create some number of threads (does not really matter how many) and make them all block on one completion port until an event (either

Linux and I/O completion ports?

只谈情不闲聊 提交于 2019-11-27 16:58:24
Using winsock, you can configure sockets or seperate I/O operations to "overlap". This means that calls to perform I/O are returned immediately, while the actual operations are completed asynchronously by separate worker threads. Winsock also provides "completion ports". From what I understand, a completion port acts as a multiplexer of handles (sockets). A handle can be demultiplexed if it isn't in the middle of an I/O operation, i.e. if all its I/O operations are completed . So, on to my question... does linux support completion ports or even asynchronous I/O for sockets? If you're looking

Is there a I/O completion port based component for Delphi?

自古美人都是妖i 提交于 2019-11-27 14:29:18
I am aware of Indy , ICS , Synapse and Clever InetSuite , none of which support IOCP . Is there anything else out there? Edit: I found iocpclasses , It's written in Delphi5. Better than nothing I suppose. Check http://voipobjects.com/index.php?page=delphi-iocp-library It is migrated iocpclasses.sourceforge.net (i'm an author). Enjoy :) Update: voipobjects has not dedicated page for this library. It lives here https://bitbucket.org/voipobjects/iocpengine . Indy 10 has experimental support for fibers and IOCP: From Indy knowledge base : Indy 10 provides experimental support for the Fiber and I/O

Simple description of worker and I/O threads in .NET

 ̄綄美尐妖づ 提交于 2019-11-27 00:17:11
It's very hard to find detailed but simple description of worker and I/O threads in .NET What's clear to me regarding this topic (but may not be technically precise): Worker threads are threads that should employ CPU for their work; I/O threads (also called "completion port threads") should employ device drivers for their work and essentially "do nothing", only monitor the completion of non-CPU operations. What is not clear: Although method ThreadPool.GetAvailableThreads returns number of available threads of both types, it seems there is no public API to schedule work for I/O thread. You can

Linux and I/O completion ports?

本秂侑毒 提交于 2019-11-26 18:51:13
问题 Using winsock, you can configure sockets or seperate I/O operations to "overlap". This means that calls to perform I/O are returned immediately, while the actual operations are completed asynchronously by separate worker threads. Winsock also provides "completion ports". From what I understand, a completion port acts as a multiplexer of handles (sockets). A handle can be demultiplexed if it isn't in the middle of an I/O operation, i.e. if all its I/O operations are completed . So, on to my

Is there a I/O completion port based component for Delphi?

本秂侑毒 提交于 2019-11-26 18:24:31
问题 I am aware of Indy, ICS, Synapse and Clever InetSuite, none of which support IOCP. Is there anything else out there? Edit: I found iocpclasses , It's written in Delphi5. Better than nothing I suppose. 回答1: Check http://voipobjects.com/index.php?page=delphi-iocp-library It is migrated iocpclasses.sourceforge.net (i'm an author). Enjoy :) Update: voipobjects has not dedicated page for this library. It lives here https://bitbucket.org/voipobjects/iocpengine. 回答2: Indy 10 has experimental support