IOCP receive strategy
- From: adam_mich@xxxxxxxxx
- Date: Sat, 13 Dec 2008 11:44:23 -0800 (PST)
Hi,
I need to write a high-performance client and server. They need to
send/receive 30-60 streams each with 1Mbit-50Mbit over TCP.
Server is simple - it uses simple circular buffer, all messages are
written to the buffer first, next overlapped requests are generated
but no more than some predefined limit. When one request are
completed , next is created pointing to the next part of the buffer
( saving locked/non-paged memory ).
But I have problems with a client. Which strategy is the best one:
a) posting zero-buffer receives, enlarging receive buffer to some
reasonable size ( lets say 256kB ). Next reading that buffer into my
message buffer, when the whole message is received pass it to my
application.
b) posting a few receive requests. I have problems how many requests I
should post and what size of the request I should use. Copying data is
still needed because I need to assembly messages as they were sent,
and they can be divided into many recv requests. Additionally much
space can be wasted because recv will not fill the provided buffers.
Is this really a much performance with b) over a) ? The first case
seems to be much easier to implement.
.
- Prev by Date: RE: RPC transports
- Next by Date: Bandwidth Limiting And/Or Calculating Speed (OS buffers data without asking me)
- Previous by thread: Problems with WNetUseConnection at windows startup and CONNECT_INTERACTIVE flag
- Next by thread: Bandwidth Limiting And/Or Calculating Speed (OS buffers data without asking me)
- Index(es):
Relevant Pages
|
Loading