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

Close sockets in IOCP (close some sockets in IOCP)

There are sockets in IOCP ..group A,B A,B are working for receiving data. But when I close sockets in group A like below. shutdown... closesocket... Sockets in group B seems like corrupted and stopped working. If anyone has experienced similar…
Mark Yang
  • 226
  • 3
  • 16
0
votes
1 answer

Pool of extended OVERLAPPED objects in a multithreaded environment: where and how to use locking efficiently

In C++, I've a Stream object which abstracts an HANDLE on Windows, and I've also various derivatives objects, such as File, TcpSocket, UdpSocket, Pipe which derives directly from that Stream object, and then I've also a RequestIo object which is my…
Marco Pagliaricci
  • 1,366
  • 17
  • 31
0
votes
1 answer

How to prevent an I/O Completion Port from blocking when completion packets are available?

I have a server application that uses Microsoft's I/O Completion Port (IOCP) mechanism to manage asynchronous network socket communication. In general, this IOCP approach has performed very well in my environment. However, I have encountered an…
charunnera
  • 357
  • 4
  • 16
0
votes
0 answers

IOCP queue not getting triggered

I am using IOCP to develop a local proxy server. I am able to read first request from a connection and send back its response successfully. In case if that's a persistent connection, i am trying to read second request from it after sending response…
mani_g
  • 151
  • 1
  • 2
  • 8
0
votes
1 answer

Coding pattern for dependant overlapped io in windows

I'm a linux programmer and recently involved in porting an epoll based client with two file descriptor written in c to windows. As you know,in linux using epoll or select (I know windows supports select, but its not efficient at all) you can block…
madz
  • 1,803
  • 18
  • 45
0
votes
2 answers

casting issue with linked list item

This is my PER_IO_CONTEXT structure (i stored them in singly linked list): typedef struct _PER_IO_CONTEXT { SLIST_ENTRY ItemEntry; WSAOVERLAPPED Overlapped; WSABUF wsabuf; /* some other data*/ }…
maciekm
  • 257
  • 1
  • 5
  • 28
0
votes
2 answers

Connecting non-IOCP client with IOCP Server

I am designing a client-server application. My server will be in C++ and using IOCP for TCP/IP communication. Decision for technology for client development not decided yet. So I have few questions regarding IOCP compatibility with client to be…
Nipun
  • 2,217
  • 5
  • 23
  • 38
0
votes
1 answer

GetQueuedCompletionStatusEx behavior when alerted

I'm using this function with fAlertable set to TRUE, because I use user alerts as a general thread interrupt mechanism in my framework. According to the comment on the MSDN page for this function, When the call enters an alertable wait state and a…
Display Name
  • 2,323
  • 1
  • 26
  • 45
0
votes
1 answer

ReadDirectoryChangesW: how to detect that the operation was successfully queued?

After calling ReadDirectoryChangesW (in overlapped mode) it returns 1 (true) in two opposite situations: 1) no files changes, 2) one or more file changed; But in first situation no data passed to IOCP and in second situation passed pointer to my…
Edward83
  • 6,664
  • 14
  • 74
  • 102
0
votes
1 answer

How to distinguish which operation was completed in IOCP processing thread?

My application can simultaneously send and receive data from the client using WSASend and WSARecv. So, How can distinguish which operation was completed in IOCP processing thread (send or receive)? BOOL bReturn =…
Tutankhamen
  • 3,532
  • 1
  • 30
  • 38
0
votes
0 answers

Losing events using IOCP Sockets on high load

For work, I need to write a server able to handle up to 8000/10000 active connections using TCP as protocol. I've used IOCP before, but I'm getting a weird situation where the server starts to lose events after high load! To test the architecture I…
Daniele Salvatore Albano
  • 1,263
  • 2
  • 13
  • 29
0
votes
1 answer

Do .NET 4.5 Server-Side WebSockets use IOCP?

Does anyone know if AspNetWebSocket (introduced in .NET Framework 4.5) utilizes IOCP for handling requests instead of one thread per Connection?
Oliver Weichhold
  • 10,259
  • 5
  • 45
  • 87
0
votes
1 answer

Active Nodes in Subnet (SendARP)

All, I am trying to find active nodes in my Subnet. For that I am sending ARP to all nodes in subnet. Is this the right way to do this ? If this is the right way, Is there any good way to handle this using IOCompletion Port or similar threading…
DevMonk
  • 427
  • 1
  • 9
  • 23
0
votes
1 answer

I/O completion ports and stdout processing

I'm using I/O completion ports for a process management library (yes, there's a reason for this). You can find the source for what I'm talking about here:…
David Hoyt
  • 11
  • 2
0
votes
2 answers

Failed DisconnectEx/AcceptEx still schedules an overlapped IOCP event

Windows 8, x64. Using overlapped Windows sockets Api with IOCP. Noticed an unexpected behavior with sockets: For example, a call to DisconnectEx returns an error WSAENOTCONN but later I receive an event in GetQueuedCompletionStatusEx for exactly…
a_m
  • 369
  • 1
  • 3
  • 12