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
2 answers

How to know if a WSASend() operation has been completed without calling GetQueuedCompletionStatus()?

When calling WSASend(), I have to pass it a WSAOVERLAPPED instance, and I cannot re-use this WSAOVERLAPPED instance until the previous WSASend() operation has been completed (i.e. when a completion packet has been placed in the completion port). Is…
Steve
  • 691
  • 5
  • 18
1
vote
0 answers

Winsock & IOCP: UDP Server. Async client management

I have a winsock-server, accepting packets from a local IP, which currently works without using IOCP. I want it to be non-blocking though, working through IOCP. Yes I know about the alternatives (select, WSAAsync etc.), but this won't do it for…
Jaro
  • 21
  • 4
1
vote
2 answers

How to juggle FILE_SKIP_COMPLETION_PORT_ON_SUCCESS, IOCP, and cleanup

If FILE_SKIP_COMPLETION_PORT_ON_SUCCESS is set on a file handle that is bound to an I/O completion port, then an OVERLAPPED structure needs to be deallocated when its I/O completes synchronously. Otherwise, it needs to stay alive until a worker…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
1 answer

TransmitFile + SChannel

I'm using the TransmitFile API with I/O completion ports for an efficient multithreaded file server on Windows. This all works fine, but I've now also implemented secure sockets using SChannel. Because TransmitFile streams the file directly to the…
Jamie M
  • 13
  • 2
1
vote
1 answer

How much IOCP queue size

How much could be the queue length in IO completion port? Is any limit for accumulated not retrieved messages? And what would be on comming over this bounder? Exception, blocking or missing new messages?
SerG
  • 1,251
  • 4
  • 18
  • 37
1
vote
0 answers

optimizing IOCP performence

playing around with Azure IotHub, I came across the following piece of code, in the Console Sample of Iot Protocol Gateway. // optimizing IOCP performance int minWorkerThreads; int minCompletionPortThreads; ThreadPool.GetMinThreads(out…
gilmishal
  • 1,884
  • 1
  • 22
  • 37
1
vote
2 answers

Windows IOCP - any advantage for single-socket application?

As I understand IOCP under Windows Server 2003/2008 and C++ programming, they are more-or-less the highest performance way to service either multiple sockets, instead of select, or to tie together multiple threads to service those requests. If my…
sdg
  • 4,645
  • 3
  • 32
  • 26
1
vote
0 answers

IO Completion Port UDP Socket, implementation and WSASendTo

I need to develop an application that uses IOCP in a UDP socket, but the material found both in the Microsoft documentation as other examples or are vague or focus in the form of implementation. I would like someone with experience in the use of…
Victor França
  • 306
  • 4
  • 15
1
vote
2 answers

IOCP in custom thread pool

I'm currently searching the internet for a custom thread pool implementation. I found an implementation which uses IOCP's. I'm wondering what the benefit is, of using them? Do they provide work stealing, or something like that, I could really find…
Martin Moser
  • 570
  • 6
  • 12
1
vote
0 answers

ConnectEx fails with WSAEISCONN after calling DisconnectEx with TF_REUSE_SOCKET

I have an IOCP based client for which I wanted to implement HTTP redirects in a following way: 1) When encountering a redirect to a different host call DisconnectEx with TF_REUSE_SOCKET 2) Await the overlapped completion and then call…
Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71
1
vote
1 answer

Unable to accept a new connection properly using IOCP - Invalid socket handle

I am learning about IOCP and have decided to write my own wrapper class based on the following article: http://www.codeproject.com/Articles/13382/A-simple-application-using-I-O-Completion-Ports-an My project is a C++ TCP server using IOCP. The…
Spook
  • 301
  • 4
  • 9
1
vote
1 answer

C# How to perform Asynchrounus I/O using Completion Ports with APM-TAP Patterns on WCF Callback?

I am trying to utilize I/O Completion Ports using WCF Callback in a Duplex Contract. I am using the following simple line to do this: OperationContext.Current.OnPushData(data); Where OnPushData is a callback contract operation that is implemented…
user5057257
1
vote
4 answers

Can I/O completion port help with database instead of File writes?

I am reading up on IOCP, and from what I understand so far, the asynchronous writes only apply in the context of writing to Files. By "Files", I don't mean just disk file, but "File" type output devices on Windows. I am planning to somehow use IOCP…
moog
  • 81
  • 1
  • 5
1
vote
0 answers

Method to use IOCP to read file in Windows

I am coding using Python 3.5. I want to use IOCP to read file in Windows. Is there any simple method to use ProactorEventLoop besides Subprocess or Executed Thread? Thanks!
ABC
  • 11
  • 2
1
vote
1 answer

How to ensure thread safe in iocp receive?

DWORD bytes; ULONG_PTR key; ChatOverlappedData* ol; if (!GetQueuedCompletionStatus(hComp_, &bytes, &key, (LPOVERLAPPED*)&ol, 0)) { return false; } int type = ol->getNetType(); if (type == net::kAction_Accept) { onAccept(ol, bytes, key); }…
Jichao
  • 40,341
  • 47
  • 125
  • 198