What is Winsock Overlapped I/O?

Posted on 2009-03-29
Last Modified: 2013-11-13

What is Overlapped I/O as available for sockets in Winsock?

How does it work and why is it more efficient than other i/o models?
Question by:nanderEire
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
LVL 10

Accepted Solution

Marcjev earned 125 total points
ID: 24014711
You should see overlapped I/O as a kind of assynchronious IO. In your program you start a function call and it returns immediatly.
So WSASend en WSAReceive will return immediatly. You will be able to receive and event when the opperation is complete.
As you can do other things in the time the system is normally in the blocking call, you cal do more efficient programming, like handling the data received in a previous opperation.
But although it has to potential to be more efficient, it's up to you, the programmer, to actually achieve the gain, by programming a more complex program.
LVL 10

Expert Comment

ID: 24014717
Also, when handling multiple connections, you could handle more connections as they are non blocking. So you could use the cpu more effectively. If you have a one to one connection the gain is not as much as having a many to one connection.

Author Comment

ID: 24016611

So what is the difference between the operation of an i/o overlapped and a socket placed in non-blocking mode?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Assisted Solution

migoEX earned 125 total points
ID: 24016755
With non-blocking socket your "send/recv" will fail with WOULD_BLOCK error code, and you'll have to retry the operation later (probably using some sort of "select"). Buth the asynchronous function continues in the background, and you can later get a notification that it has completed/failed (in form of Event or callback).

Author Comment

ID: 24016929
So you can just keep queueing up the sends without checking the return value to see if each was successful?

Expert Comment

ID: 24017355
Yes. I assume there's some limit, of cause, but in theory you can sedn many requests whithout waiting for any to complete.

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question