iocp

When I call WSASend(), will all the data be sent?

倖福魔咒の 提交于 2019-12-04 15:38:59
When using IOCP, if I call WSASend() with let's say 2 KB of data. When I receive a completion notification, will this completion notification indicate that the entire 2 KB were sent, or there could be some bytes that were not sent? Under normal circumstances, yes, your completion will receive notification that the entire 2 KB was sent, as long as the socket is using overlapped I/O. The only scenario where it may return less than the size of the data sent is when the connection is terminated in the middle of a send; in this case, it returns the partial number of bytes sent. If it's not using

Resources To learn IOCP On Windows

点点圈 提交于 2019-12-04 14:34:52
问题 I recently was made aware of this thing called IOCP on windows and i began searching for more information on it but i couldn't find anything up to date (most of the examples were on codeproject almost 5 years old) and not too many guides or tutorials. Can anyone recommend any up to date resources about it in the form of online tutorials or example projects (that you wrote and can share or other open source projects) or even a book about it because if it's as good as it sounds i plan to use it

TCP/IP server using IOCP. Occasional data corruption in receive buffers

∥☆過路亽.° 提交于 2019-12-04 13:28:51
I’ve been working on an TCP/IP IOCP server application. I’ve been testing performance (which seems in line with TCP throughput testing utilities) and now have been testing data integrity – this is where I am getting some “weirdness”. As an initial test, I decided to have a test client send a 1MB block of data over and over where that block is just a sequence of integers incremented one after the other. The idea being that I can verify that each received buffer of data is consistent with no missing data in that buffer, independent from any other buffer received, meaning I don't need to worry

What's the best way to ping many network devices in parallel?

Deadly 提交于 2019-12-04 11:32:04
问题 I poll a lot of devices in network (more than 300) by iterative ping. The program polls the devices sequentially, so it's slow. I'd like to enhance the speed of polling. There some ways to do this in Delphi 7: Each device has a thread doing ping. Manage threads manually. Learn and use Indy 10. Need examples. Use overlapped I/O based on window messages. Use completion ports based on events. What is faster, easier? Please, provide some examples or links for example. 回答1: Flooding the network

Timer that supports overlapped I/O (for IOCP)?

懵懂的女人 提交于 2019-12-04 09:02:49
I need to add timers support in an application based on I/O Completion Ports (IOCP). I would like to avoid the use of a specific thread to manage timers. On Linux, you can create a timer that delivers expiration notifications via a file descriptor (see timerfd.h man), so it's great to use it for example with epoll if your application is based on epoll. On Windows, you can use "waitable timers" with an asynchronous procedure call (ACP) (see http://msdn.microsoft.com/en-us/library/ms686898(v=VS.85).aspx ) If you are interested, kqueue (BSD, Mac OS) supports timers by default (see EVFILT_TIMER).

TCP/IP IOCP received data sometimes corrupt - Visual C++ on Windows

十年热恋 提交于 2019-12-04 07:21:48
I am writing a simple test ICOP client and server to ensure I am using the API correctly and that the data the client sending is being received correctly by the server. I have included all the code for this question. This is where I ran into some problems, that the data within the receive buffers sometimes seems to be corrupted (corrupted in that sometimes chunks of data within buffers can be out of order or missing). To be clear, this is data within individual receive buffers, I don’t mean out of order between multiple buffers because of thread scheduling issues. I previously posted a

IO completion port key confusion

流过昼夜 提交于 2019-12-04 05:36:07
I'm writing an IO completion port based server ( source code here ) using the Windows DLL API in Python using the ctypes module. But this is a pretty direct usage of the API and this question is directed at those who have a knowledge of IOCP, not Python. As I understand the documentation for CreateIoCompletionPort, you specify your "user defined" completion key when you call this function with a file handle (in my case a socket) you are associating with the created IOCP. When you get around to calling GetQueuedCompletionStatus, you get a completion key value along with a pointer to an

some OVERLAPS using WSASend not returning in a timely manner using GetQueuedCompletionStatus?

对着背影说爱祢 提交于 2019-12-03 21:47:00
Background: I'm using CreateIoCompletionPort, WSASend/Recv, and GetQueuedCompletionStatus to do overlapped socket io on my server. For flow control, when sending to the client, I only allow several WSASend() to be called when all pending OVERLAPs have popped off the IOCP. Problem: Recently, there are occassions when the OVERLAPs do not get returned to the IOCP. The thread calling GetQueuedCompletionStatus does not get them and they remain in my local pending queue. I've verified that the client DOES receive the data off the socket and the socket is connected. No errors were returned when the

Using IOCP with UDP?

梦想的初衷 提交于 2019-12-03 18:26:46
问题 I'm pretty familiar with what Input/Output Completion Ports are for when it comes to TCP . But what, if I am for example coding a FPS game, or anything where need for low latency can be a deal breaker - I want immediate response to the player to provide the best playing experience, even at cost of losing some spatial data on the go. It becomes obvious that I should use UDP and aside from sending coordinate updates frequently, I should also implement kind of semi-reliable protocol (afaik TCP

Resources To learn IOCP On Windows

自作多情 提交于 2019-12-03 08:29:25
I recently was made aware of this thing called IOCP on windows and i began searching for more information on it but i couldn't find anything up to date (most of the examples were on codeproject almost 5 years old) and not too many guides or tutorials. Can anyone recommend any up to date resources about it in the form of online tutorials or example projects (that you wrote and can share or other open source projects) or even a book about it because if it's as good as it sounds i plan to use it extensively so i will invest in it. Thank You. IOCP is a feature that has been in Windows since the