Unify of the internal API of asynchronous handling
It makes sense to unify internal methods of asynchronous I/O where to each
method of start of operation corresponds the method of completion of
operation:
* startAsyncCommunication() - it is a new method which has a code relating
to the handling of the WaitCommEvent() function. It implementations is taken
directly by copy/paste with minimal modifications relating with adding of
returns a boolean values.
* _q_completeAsyncCommunication() - it is an existing method which is renamed
from the _q_canCompleteCommunication().
* startAsyncRead() - it is an existing method without modifications.
* _q_completeAsyncRead() - it is an existing method which is renamed from
the _q_canCompleteRead(). Earlier this method contained a subfunction of
the completeAsyncRead(DWORD) which is deleted now, and its code (related with
the policy processing) is moved into body of the _q_completeAsyncRead() with
the minimum modifications which do not change it behavior.
* startAsyncWrite() - it is an existing method without modifications.
* _q_completeAsyncWrite() - it is an existing method which is renamed from
the _q_canCompleteWrite(). Earlier this method contained a subfunction of
the completeAsyncWrite(DWORD) which is deleted now, and its code is moved
into body of the _q_completeAsyncWrite() without modifications.
Also in addition is added the new method emitReadyRead() and the code of
policy emulation is moved into new method emulateErrorPolicy().
Change-Id: I58345e3270d676879a16efc4b7f35f74869894d8
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>