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
4
votes
1 answer

How to deal with a case where multiple operations are posted on the same socket

I am developing a client application that manages one socket. I am using IOCP to manage asynchronous I/O. This is a quote from a networking programming book: All overlapped operations are guaranteed to be executed in the order that the application…
jpen
  • 2,129
  • 5
  • 32
  • 56
3
votes
1 answer

How to safely stop a IOCP WSARecv() task, and free the WSAOVERLAPPED structure?

My IOCP server program will cost more and more memory while running. After tracking memory leak ,I found that some WSAOVERLAPPED structue feed to WSARecv() is never recycled. I think this is because some malignant client socket only establish…
Dery
  • 177
  • 1
  • 11
3
votes
2 answers

.NET IOCP ThreadPool overhead with async UDP operations

I have developed a VoIP media server which exchanges RTP packets with remote SIP endpoints. It needs to scale well - and while I was initially concerned that my C# implementation would not come close to the C++ version it replaces, I have used…
MikeBrom
  • 149
  • 7
3
votes
0 answers

How good IOCP scales across multiple threads?

There is no public data on the actual IOCP performance. Does anyone know how good IOCP scales on say 128 cores - does it reach 1 mil. ops/sec on a good hardware? Since IOCP queue is itself a shared resource between multiple threads which all…
Dmitry Sychov
  • 237
  • 7
  • 16
3
votes
1 answer

Waiting for GUI events and IOCP notifications at once

Can I wait for GUI events — that is, pump a message loop — and on an I/O completion port at the same time? I would like to integrate libuv with the Windows GUI.
Demi
  • 3,535
  • 5
  • 29
  • 45
3
votes
1 answer

Async IO without completion port?

// 1- using(FileStream file = File.Open("ConfusedDev", FileMode.Open)) { await file.ReadAsync(buffer, 0, 1024); Thread.Sleep(Timeout.Infinite); // threadpool shows 1 worker thread in use } // 2- using(FileStream file = new…
watashiSHUN
  • 9,684
  • 4
  • 36
  • 44
3
votes
2 answers

Mono and C# IOCP: Is it a good idea?

I'm porting a c++ app to c# that uses IOCP on it's server. Can mono handle IOCP as well as windows? will i get comparable performance to c++ or i should try something else? thanks
Joao Vilaca
  • 618
  • 1
  • 7
  • 18
3
votes
1 answer

What is the order of the completion packets for WSASend() and WSARecv() in this case?

Say that I have two programs, a client and a server, and that I am running the client and the server on the same computer (so the speed is extremely fast), and say that the client socket's receive buffer is empty, and that the server will not send…
Steve
  • 691
  • 5
  • 18
3
votes
1 answer

Reusable test code that waits for IO

I'm experimenting with using async/await on WCF exposed methods/services. Everything works fine but I'd like to simulate the service method actually waiting for IO so that the service call will be registered with an IO completion port, and the…
redcalx
  • 8,177
  • 4
  • 56
  • 105
3
votes
1 answer

IOCP notification without completion key

I am building an IOCP/RIO Winsock server and have been struggling with getting the proper notification from the completion port when my AcceptEx() calls are triggered by a client request. When I call GetQueuedCompletionStatus() after having sent a…
Michael220
  • 193
  • 12
3
votes
1 answer

An IOCP documentation interpretation question - buffer ownership ambiguity

Since I'm not a native English speaker I might be missing something so maybe someone here knows better than me. Taken from WSASend's doumentation at MSDN: lpBuffers [in] A pointer to an array of WSABUF structures. Each WSABUF structure contains…
Poni
  • 11,061
  • 25
  • 80
  • 121
3
votes
1 answer

Winsock asynchronous multiple WSASend with one single buffer

MSDN states "For a Winsock application, once the WSASend function is called, the system owns these buffers and the application may not access them." In a server application, does that mean that if I want to broadcast a message to multiple clients I…
Megatron
  • 123
  • 1
  • 11
3
votes
1 answer

Completion key vs extending the OVERLAPPED structure

I am not sure what approach I should take when dealing with data associated with each socket. Should I use the completion key or should I extend the OVERLAPPED structure. Extending the OVERLAPPED structure seems like a hack, so does it offer any…
user4572253
3
votes
2 answers

WSARecv() and the lpNumberOfBytesRecvd parameter

The documentation for WSARecv() says the following about the lpNumberOfBytesRecvd parameter: A pointer to the number, in bytes, of data received by this call if the receive operation completes immediately. Use NULL for this parameter if the…
user4592590
3
votes
1 answer

IO Completion Ports and socket send()

Based on my understanding so far of IOCP, when I create a completion port and associate a socket to it, a notification will be sent to the completion port when a socket is ready to be read. But how send() is handled, I mean if I want to send data,…
user4582812
  • 591
  • 1
  • 4
  • 16