Questions tagged [iocp]

An I/O Completion Port (IOCP) provides a way to execute asynchronous I/O operations efficiently on Windows.

An I/O Completion Port (IOCP) provides a way to execute asynchronous I/O operations efficiently on Windows.

It can be used by the native CreateIoCompletionPort() function. It's also used internally by some of the types that use the Begin*-End* asynchronous programming model in .Net.

350 questions
0
votes
2 answers

What's the maximum connects can IOCP accept and hold

I do some IOCP Server and Client test. The IOCP Server accept the clients' connects and do nothing but recv datapackets from clients. The clients connect the server and send datapackets to server in an infinit loop. I set a counter. It increase when…
Celebi
  • 1,280
  • 3
  • 16
  • 25
0
votes
1 answer

Strange IOCP behaviour when communicating with browsers

I'm writing IOCP server for video streaming from desktop client to browser. Both sides uses WebSocket protocol to unify server's achitecture (and because there is no other way for browsers to perform a full-duplex exchange). The working thread…
Iceman
  • 365
  • 1
  • 3
  • 17
0
votes
0 answers

Winsock IOCP Weird Behaviour On Disconnect Flood

I'm programming a Socket/Client/Server library for C#, since I do a lot of cross-platform programming, and I didn't find mono/dotnet/dotnet core enough efficient in high-performance socket handling. Sice linux epoll unarguably won the performance…
beatcoder
  • 683
  • 1
  • 5
  • 19
0
votes
0 answers

Do Windows IO Completion Ports work with classes as completion keys?

TLDR - GetQueuedCompletionStatus does not return if I provide a class object as the completion key, it returns only if structure object is passed instead. I created a IOCP in main thread using CreateIoCompletionPort ShareInfo* l_poShareInfo = new…
Praveen
  • 73
  • 2
  • 5
0
votes
0 answers

Race condition with IOCP reading file

I'm trying to use IOCP to do async file reads. This works fine 99% of the time.. but that 1% of the time a request seems to never finish and so the operation just waits forever. The sequence of API calls for the file that hangs is # Time of Day…
Phyx
  • 2,697
  • 1
  • 20
  • 35
0
votes
0 answers

WsaRecv/GetQueuedCompletionStatus reads the data late

we are using IOCP with winsock 2 in vc++ and overlapped WsaRecv to issue async read request on socket. worker threads are waiting on GetQueuedCompletionStatus to receive the data. we have applied wireshark and observed that some times not everytime…
Mubashir Khan
  • 1,464
  • 1
  • 12
  • 17
0
votes
0 answers

I/O Completion ports when to increase/decrease the RefCount of Per socket in a multi-threaded design?

I read this question I/O Completion Ports *LAST* called callback, or: where it's safe to cleanup things And i can not get my issue solved. The answer does not fully cover this method. I have also searched a lot here and in google but can not find a…
LYC
  • 1
0
votes
1 answer

Zero byte receives: purpose clarification

I am learning server development with IO Completion Ports. My book, "Network Programming for Microsoft Windows - Second Edition", states the following: With every overlapped send or receive operation, it is probable that the data buffers…
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
0 answers

How to send wchar_t string from C++ app to nodejs script

I have C++ service which sends whar_t strings to nodejs script. To send messages it uses IOCP WSASend. The problem is that pretty often nodejs can't receive (decode) those messages correctly. the message itself is a serialized json with SOH (\u0001)…
htonus
  • 629
  • 1
  • 9
  • 19
0
votes
1 answer

IO Completion ports: separate thread pool to process the dequeued packets?

NOTE: I have added the C++ tag to this because a) the code is C++ and b) people using C++ may well have used IO completion ports. So please don't shout. I am playing with IO completion ports, and have eventually fully understood (and tested, to…
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
1 answer

NumberOfConcurrentThreads parameter in CreateIoCompletionPort

I am still confused about the NumberOfConcurrentThreads parameter within CreateIoCompletionPort(). I have read and re-read the MSDN dox, but the quote This value limits the number of runnable threads associated with the completion port. still…
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
1 answer

AcceptEx() synchronous completion?

I am using IO completion ports and AcceptEx() whilst learning about servers, and am studying Len Holgate's free server framework to do this. He has the following code: // Basically calls AcceptEx() via a previously obtained function pointer if…
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
2 answers

Closing sockets that haven't completed AcceptEx - if and how?

I understand that if I issue an AcceptEx call, through a function pointer as recommended by the documentation, then if I specify a receiver buffer size, the call will not complete until some data is sent: if (!lpfnAcceptEx(sockListen, …
Wad
  • 1,454
  • 1
  • 16
  • 33
0
votes
2 answers

Win32 IOCP with serial port not working

I've edited this question after gathering more information. I'm trying to use IOCP for communication through a serial port. I open the serial port with the overlapped flag: HANDLE hComm = CreateFile(strPortName, GENERIC_READ | GENERIC_WRITE, …
Ken
  • 427
  • 4
  • 20
0
votes
1 answer

Two sockets that ConnectEx to the same IP address and port produce duplicate IOCP events

I have a client application that uses IOCP for socket communication. I'm using ConnectEx to make the TCP connection to the remote endpoing (binding the socket to ADDR_ANY and port 0 before calling ConnectEx). It will be valid to have two connections…
Ken
  • 427
  • 4
  • 20