FAQ Database Discussion Community


How does Overlapped I/O relates to the concept of blocking and non-blocking sockets?

c++,windows,sockets,network-programming,overlapped-io
I am wondering does using Overlapped I/O means that I am using the socket in a non-blocking mode, or does the concept of blocking and non-blocking sockets is not related to the concept of Overlapped I/O.

Is Overlapped I/O used on the client side also?

c++,windows,sockets,network-programming,overlapped-io
I think that Overlapped I/O was invented to be used on the server side, mainly to be able to handle thousands of clients. So I do not think that there is any reason to use it on the client side. is my assumption correct?

is the overlapped structure updated when using ReadFile?

c++,winapi,readfile,overlapped-io
I'm learning something on win32 programming. I read on the reference manual (here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365467%28v=vs.85%29.aspx ) that If lpOverlapped is not NULL, the read operation starts at the offset that is specified in the OVERLAPPED structure and ReadFile does not return until the read operation is complete. The system updates the...

Read lines from file async using WINAPI ReadFile

c++,multithreading,winapi,createfile,overlapped-io
I need to read several lines from file simultaneously, i.e. asynchronously. Lines in file are of the same size. For instance, I need to read the second and the fourth lines of file to separate variables or to an array. I'm more used to c#'s async/await and all these OVERLAPPED...

Should I use AcceptEx() or WSAAccept()?

c++,sockets,winapi,network-programming,overlapped-io
I am using Overlapped IO, I want to accept client connections using a blocking call, the same way I do with a normal accept(). I am not sure but I think that AcceptEx() does not block, while WSAAccept() does. So is WSAAccept() similar to accept()?

WSASend completion routine has never been called

c++,windows,winsock,winsock2,overlapped-io
I'm playing around with Overlapped IO and suddenly found out that it looks like I'm the only one who can't encourage Completion callback to work (All claims was about: it works and I don't like it). The idea of my application is: a client (telnet localhost 27015) connects to the...

Should WSASocket() be used with IOCP?

c++,sockets,winsock,iocp,overlapped-io
I know that it is recommended to use WSAAccept() instead of accept() when creating an IOCP application. But I am not sure if WSASocket() belongs to the Overlapped I/O functions, or is it just another Winsock function?

C++ serial library's use of Win32 synchronization functions?

c++,winapi,serial-communication,overlapped-io
I'm having some trouble understanding an example from Klein's serial library for C++. About halfway down this page, there is a section called "Use of Win32 synchronization objects" which I'm having trouble following. http://www.codeproject.com/Articles/992/Serial-library-for-C // Create a handle for the overlapped operations HANDLE hevtOverlapped = ::CreateEvent(0,TRUE,FALSE,0);; // Open the "STOP"...

Why is it called Overlapped I/O?

c++,windows,sockets,terminology,overlapped-io
All I can find is tutorials on how to use Overlapped I/O, but I can't find why is it called like that. Is it because for example I can read something from a socket, and then read something else before necessarily the first read returns the bytes read?...