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

Extract local endpoint info (IP address and port) when using ConnectEx + IOCP

I am trying to create a client application that will use asynchronous IO using IOCP. I already did similar server application and it works correctly, however I can't find any information on how to extract local endpoint information from socket that…
Alexander Bily
  • 925
  • 5
  • 18
0
votes
1 answer

how to ensure thread safe when using IOCP in multithread in windows?

if i CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, 4), then when call PostQueuedCompletionStatus(), the 4 threads which run GetQueuedCompletionStatus() will maybe be return from GetQueuedCompletionStatus(). so if i want to send some data…
goforward
  • 1
  • 2
0
votes
1 answer

Change/Update the CompletionKey

ULONG_PTR CKey = 2; CreateIoCompletionPort(...Ckey...); Is it possible to change/update the CompletionKey somehow after I called the function? Also, an operation happening on both serversock and clientsock (E.g. AcceptEx in a mode that both…
Arre
  • 125
  • 1
  • 7
0
votes
0 answers

How can I make the LIFO principle apply to callbacks?

I'm not one hundred percent sure what the benefit of "LIFO" (regarding threads) in the IOCP is. I guess the last thread that comes back to the "LIFO queue" can be used with less "overhead" than the others. (Correct me if I'm wrong.) Let's say we…
Arre
  • 125
  • 1
  • 7
0
votes
1 answer

Packet Delay Variation (PDV)

I am currently implementing video streaming application where the goal is to utilize as much as possible gigabit ethernet bandwidth Application protocol is built over tcp/ip Network library is using asynchronous iocp mechanism Only streaming over…
truthseeker
  • 1,220
  • 4
  • 25
  • 58
0
votes
0 answers

Do I need to consider using IOCP server and dead reckoning if server sends about 180,000 bytes of packets per second?

I'm currently designing MORPG server and I have a question about which i/o model I should use. It's fast-paced 3rd person RPG and 1~3 players can join a session. In the worst case, about 50 enemies can be shown. I thought this could be too much…
Jeongmin Heo
  • 61
  • 1
  • 7
0
votes
1 answer

iocp openssl peer server closes the connection after connecting with ConnectEx

I have problems making openssl working with iocp on windows , currently trying client mode only I could make async write and read using the memory bios but but I'm struggling to get the async connect and handshake work if I connect using SSL_connect…
dev65
  • 1,440
  • 10
  • 25
0
votes
2 answers

GetQueuedCompletionStatus delayed

I have written complex library for managing network communication based on iocp mechanism. Problem is that when server closes the connection by calling API method closesocket() this information is sometimes transmitted to client delayed by seconds…
truthseeker
  • 1,220
  • 4
  • 25
  • 58
0
votes
0 answers

QueuUserAPC sometimes doesn't launc an apc routine in a thread waiting with GetQueuedCompletionStatusEx

I'm working on a simple async socket client built on top of winsock with io completion ports it sometimes works and sometimes blocks with strange behaviours this is the design of the async process : there are global iocp threads running to receive…
dev65
  • 1,440
  • 10
  • 25
0
votes
1 answer

Can too many WSASend in short time be a problem?

I'm making a simple mmorpg server with IOCP. I implemented a simple movement function so I tested with dummy clients(also IOCP). Everything works fine only when few clients are connected. After around 500~1000 clients are connected, some dummy…
Jeongmin Heo
  • 61
  • 1
  • 7
0
votes
0 answers

Winsock UDP IO Completion Port: Unable to use WSASendTo

I am trying to write a UDP server with a worker thread that keeps calling GetQueuedCompletionStatus. I can already receive data successfully with WSARecvFrom but sending data with WSASendTo causes the following error: 10045: The attempted operation…
user3670011
  • 194
  • 11
0
votes
1 answer

How close a socket (with IOCP) properly after sending?

I'm having problem with Winsock2 using IOCP (overlapped IO mode) when I need to close the connection after sending the requested data. I've discovered if I send some data and close the socket immediately after sending, then the data will not be (or…
beatcoder
  • 683
  • 1
  • 5
  • 19
0
votes
1 answer

IOCP ReadFile always blocks until read completion

This is an example source for reading files using iocp. It should be returned immediately because it makes an asynchronous call when calling ReadFile, which seems to work synchronously. What is the problem? he test environment is visual studio 2017…
webnoon
  • 945
  • 3
  • 9
  • 18
0
votes
0 answers

how to detect disconnection in IOCP server using zero byte recv

I'm currently implementing IOCP server for a game and I'm trying zero bytes recv technic. I have 3 questions. If you know disconnection from the client by checking if bytestransferred is 0, then how do you distinguish between receive completion…
Jeongmin Heo
  • 61
  • 1
  • 7
0
votes
1 answer

Do I need to make clients support iocp when the server is iocp based?

I'm currently making 3d game with iocp based server. My question here is that is there any reason in making clients support iocp io? Because I think I only need one or two threads for io.
Jeongmin Heo
  • 61
  • 1
  • 7