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
1
vote
1 answer

Is it necessary to set hEvent on the OVERLAPPED structure when doing I/O completion ports?

I'm using I/O completion ports on Windows for serial port communication (we will potentially have lots and lots of serial port usage). I've done the usual, creating the IOCP, spinning up the I/O threads, and associating my CreateFile() handle with…
dhoyt
  • 106
  • 5
1
vote
0 answers

Creating a threadpool for IOCP

Regarding IOCP and Threadpools, should I use a specific function to create a "thread pool"? Right now I create my "thread pool" by calling CreateThread as many times as the number of threads I want in the pool. I then assumed that all the threads…
Arre
  • 125
  • 1
  • 7
1
vote
1 answer

difference between netty running on Linux and Windows

Netty's I/o multiplexing depends on epoll on a Linux system, but is the performance the same when running netty on a Windows operating system? Windows without epoll,how does netty work?iocp? Thank you for your answer.
JamY
  • 13
  • 2
1
vote
0 answers

Difference between _ThreadPoolWaitCallback.PerformWaitCallback and _IOCompletionCallback.PerformIOCompletionCallback

I'm try to understand iocp and io completion threadpool. For all I know, IO operate like http request via iocp and io completion thread to execute callback code. But I found some difference between File read, Http request and SQL query. class…
Hourglass
  • 150
  • 1
  • 10
1
vote
0 answers

WinSock and IOCP readiness notification

I was reading this post where someone mentions the ability to get notifications when a socket is ready to read instead of getting a notification when reading is finished - by submitting a 0 sized buffer. ... WSABUF DataBuf; DataBuf.len =…
Julius
  • 1,155
  • 9
  • 19
1
vote
2 answers

Reading a socket asynchronously with `read` and `epoll`

There's something I miss when it comes to epoll In Win32, If a socket is registered under some IOCP and no data is available for the socket to read, then issuing an asynchronous read action using ReadFile with some overlapped struct will return…
David Haim
  • 25,446
  • 3
  • 44
  • 78
1
vote
1 answer

Which handle to pass to CreateIoCompletionPort, if using IOCP for basic signaling?

Background: As described in this article, Designing Applications for High Performance: Consider using PostQueueCompletionStatus rather than SetEvent API. The latter boosts the target thread’s priority by 1 which may cause it to preempt something…
Lou
  • 4,244
  • 3
  • 33
  • 72
1
vote
1 answer

GetQueuedCompletionStatus continues to select events on closed sockets

IOCP server works with WebSocket connections. When the browser sends a close frame, the server deletes this client, the closesocket function is calling in client's object destructor. But even after the socket was closed, the…
Iceman
  • 365
  • 1
  • 3
  • 17
1
vote
1 answer

Is WSASend with IOCP ordered?

I would like to create a IOCP application to received TCP data, Once received, I will have to processing the data and write out the bytes partially. Understand that WSASend with IOCP can do the job. But I am worrying whether WSASend to the queue and…
Oktaheta
  • 606
  • 5
  • 21
1
vote
0 answers

Can IOCP servers be cycle/tick based? Delaying between each client process cycle?

I'm wrote an MMO server where there is one main loop and all clients are processed (packets read/sent) (Non blocking) and then theres a small 500 ms delay/tick before the next loop. I want to start working with IOCP, can this style server be done…
bigdos
  • 11
  • 1
1
vote
1 answer

wsasend lpnumberofbytesSent

I am using wsasend on an IOCP structured server. There is one problem. wsabuf [bufcount - 1] .buf = pPacket-> GetPacketBufferPtr (); wsabuf [bufcount - 1] .len = (int) pPacket-> Get_PacketSize (); iSendSize + = wsabuf [bufcount - 1] .len; bufcount…
NamHyuk Im
  • 11
  • 2
1
vote
2 answers

mysql lost connection error

Currently, I am working on a project to integrate mysql with the IOCP server to collect sensor data and verify the collected data from the client. However, there is a situation where mysql misses a connection. The query itself is a simple query that…
jm Park
  • 11
  • 2
1
vote
1 answer

IOCP WSARecv always return error 10022

I'm using IOCP on Windows. Previously I used method GetQueuedCompletionStatus to poll the queue and everything was fine. But when I decided to refactor the logic in the way to utilize completion routine with WSARecv call it always fails with the…
htonus
  • 629
  • 1
  • 9
  • 19
1
vote
1 answer

How does .NET handle IOCP thread safety?

I'm playing with SocketAsyncEventArgs and IO Completion Ports. I've been looking but I can't seem to find how .NET handles race conditions. Need clarification on this stack overflow question: https://stackoverflow.com/a/28690948/855421 As a side…
Lews Therin
  • 10,907
  • 4
  • 48
  • 72
1
vote
1 answer

Easiest way to add SSL to a IOCP based windows server?

I have a IOCP based server which we have used for long time. Now we need to add SSL support to this. I am struggling to find a clean solution. I have found two options suggested in the other two threads - 1) Use openssl Memory BIO - but have not…
NiladriBose
  • 1,849
  • 2
  • 16
  • 31