Home > Software engineering >  New people for help, the problem of completion port to send data
New people for help, the problem of completion port to send data

Time:09-24

I consulted most of the information is said completion port, receive data, once I start trying to send data, there are a few problems, the first is don't know what's model, I was outside of the worker thread calls WSASend regardless of the other, or what kind of function to let the worker threads to complete WSASend GetQueuedCompletionStatus, the second is the actual use WSASend function when I need to send this one to construct the corresponding IO structure and handle structure thus to apply for a memory that not every to send data to apply for a memory when release the memory, how to release,

CodePudding user response:

Completion port is the most complicated but win communication is one of the most efficient mechanism, and if there is no clear understanding and the understanding to its mechanism, it is difficult to do, advice, look for the customs information to learn first

CodePudding user response:

http://bbs.csdn.net/topics/392070135

CodePudding user response:


Don't build towers, the has
Iocp need deep understanding iocp mechanism of Windows,

CodePudding user response:

Not, it is found the problem when learning IOCP don't know how to do, how come all advised me not to learn

CodePudding user response:

refer to the original poster qq_37062864 response:
I consulted most of the information is said completion port, receive data, once I began to try to send data, there are a few problems, the first is don't know what mode, I was outside of the worker thread calls WSASend regardless of the other, or what kind of function to let the worker threads to complete WSASend GetQueuedCompletionStatus, the second is the actual use WSASend function when I need to send this one to construct the corresponding IO structure and handle structure thus to apply for a memory that not every to send data to apply for a memory when release the memory, how to release,

IOCP data processing, are first delivery, post-processing
So WSASend, will need to apply for memory, after the success of the application to carry data sending
And then receives the data processing results in the GetQueuedCompletionStatus, release the memory to apply for the
This a recommendation to build an object pool, try to reuse the delivery object,
Submit efficiency also reduce memory fragments
Of course because involve multithreading, object pooling lock is little not
  • Related