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

How many sockets to create on the client side?

I see some applications use multiple sockets. For example for chat they use unique socket and for file upload they use other socket etc. Why this process is needed when it can be done in one socket? is it because the way they handle the connection…
RCECoder
  • 247
  • 1
  • 5
  • 15
0
votes
1 answer

closesocket() not completing pending operations of IOCP

I am currently working on a server application in C++. My main inspirations are these examples: Windows SDK IOCP Excample The I/O Completion Port IPv4/IPv6 Server Program Example My app is strongly similar to these (socketobj, packageobj, ...). In…
Woife
  • 27
  • 8
0
votes
1 answer

Is it OK for a text editor to pass each keypress from one thread to another?

I'm implementing a Win32 Console text editor that has an internal message queue for passing around information about which areas to redraw, messages to/from plugins, etc. I prefer it to be single-threaded by default (if there's nothing happening…
jhkouy78reu9wx
  • 342
  • 2
  • 8
0
votes
3 answers

TCP IOCP won't receive after acceptex

I'm trying to write an IOCP server. Basically, I have it accepting new connections. For the purpose of my testing, I'm running and connecting to 127.0.0.1. I create the pseudo socket prior to calling AcceptEx(). Once a connection is accepted, the…
MarkP
  • 4,168
  • 10
  • 43
  • 84
0
votes
1 answer

Memory usage with IOCP

I am converting our code to use IOCP and I got the communication relatively stable, but the memory usage of the application is increasing. Looks like I am getting back (on completion function calls) much fewer objects of OverlappedEx than I create.…
MUXCAH
  • 205
  • 1
  • 6
0
votes
0 answers

Windows IOCP synchronization strategy

Good day all. I am in the process of moving our server application (mostly UDP) from a thread-per-socket strategy to IOCP. The IOCP part works well, however the treads that send/receive the data don't do the actual data processing. For now they save…
MUXCAH
  • 205
  • 1
  • 6
0
votes
0 answers

Windows IOCP for real time

I have a question related to IOCP networking strategy for our C++ server application. Our server simulates a lot of devices which speak over UDP with short (less than 2K) messages. The server is also bound by a soft real-time constraint of 70-100…
MUXCAH
  • 205
  • 1
  • 6
0
votes
1 answer

Binding to a UDP socket for IOCP using C

I am trying to read from a UDP port, from a local (loopback) application, using IOCP. IOCP works fine for TCP/IP, but I am unable to open the socket properly for UDP. This is what I am doing: // same as for tcp/ip struct sockaddr_in remoteAddr = { 0…
Lou
  • 4,244
  • 3
  • 33
  • 72
0
votes
3 answers

Using IOCP with multiple listeners

How do I setup IOCP sockets for multiple listeners (on different ports)? Every example I find online is just a single server - multiple clients example, and I don't understand if I supposed to create multiple IOCPs, or use only one for all listeners…
Lou
  • 4,244
  • 3
  • 33
  • 72
0
votes
0 answers

IOCP+WSASend pending forever upon receiving TCP ZeroWindow signal from peer

The symptom: TCP client(IOCP+Winsock) stuck at GetQueuedCompletionStatus() when sending(WSASend) very large amount of data to the TCP server. I am using using two TCP clients sending traffic to a single TCP server (2 TCP connections end on the…
Johan
  • 1
  • 2
0
votes
1 answer

How to close a SOCKET when using IOCP?

I have a server application that uses IOCP. I want to know what is the proper way to close a SOCKET. If I simply call closesocket() (for a SOCKET with a handle of for example 12345), and this SOCKET has pending IO operations (for example: a pending…
Steve
  • 691
  • 5
  • 18
0
votes
2 answers

My graphic representation and interpretation of socket-based models

http://img600.imageshack.us/img600/3567/graphicrepresentation.png Am I reasoning right way? If so, could anyone please show me, like in scheme above, how would I/O Completion Ports work? Before I'll start to learn about making high-performance…
Pythagoras of Samos
  • 3,051
  • 5
  • 29
  • 51
0
votes
0 answers

Crashes with hooked GetQueuedCompletionStatus

i'm hooking GetQueuedCompletionStatus function with code below: // hook code typedef BOOL (__stdcall * MyGetQueuedCompletionStatus)( _In_ HANDLE CompletionPort, _Out_ LPDWORD lpNumberOfBytes, _Out_ PULONG_PTR lpCompletionKey, …
Kracken
  • 662
  • 1
  • 11
  • 27
0
votes
0 answers

WSASend performance trick with caching

I'm very new in the network programming, i writed an IOCP network for Windows with c++, but i have a big contradiction; many threads can send to same socket, so i used a lock before WSASend because i read about WSASend is not thread-safe, my…
0sk1
  • 27
  • 1
  • 7
0
votes
1 answer

How do I properly shut down an IOCP server?

I can find tonnes of article's about starting up an IOCP server, but none about properly shutting it down =/ What is the proper way to shut the server down when you are done? more specifically, I already use PostQueuedCompletionStatus() to tell the…
CuriousGeorge
  • 7,120
  • 6
  • 42
  • 74