Skip a lot of extraneous logic in VSockSocket_Send and VSockSocket_Recv
by using vmci_qpair_enqueue and vmci_qpair_dequeue directly. This is the
same idea as what happens on Mac OS X when data is copied into the host
pipe in VSockOS_HandleStreamRecv. This allows us to copy data out of the
queue pair as quickly as possible and flush send buffers into the queue
pair without waiting for a callback on the poll thread. Client callbacks
must still be fired on the poll thread to preserve the AsyncSocket API.
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
{
ASSERT(s);
ASSERT(result);
+ ASSERT(s->recvFn);
+ ASSERT(s->recvBuf);
+ ASSERT(s->recvLen > 0);
+ ASSERT(s->recvPos <= s->recvLen);
if (s->recvPos == s->recvLen || s->recvFireOnPartial) {
void *recvBuf = s->recvBuf;