Reading blocks of data from socket
- From: "Dilip" <rdilipk@xxxxxxxxx>
- Date: 10 Jul 2006 13:26:01 -0700
Hi
I have an application that connects to server via TCP. Right now, the
way the protocol is designed, I read a few bytes initially from the
socket, say 'n'. One of the fields in the n bytes tells me how much
more to read to absorb the entire packet of data. I read that much,
loop back and repeat the process by once again reading n bytes. I do
this kind of looping close to 100,000 times over a span of 3-4 mins.
The application is designed to do this kind of thign all day.
I was just wondering, wouldn't it be a good idea to read a huge block
of data (say like 10,000 bytes) from the socket, store it in memory and
let the program logic interpret the packets in-memory rather than from
the socket thus reducing the amount of I/O? or am I going down the
path of premature optimization?
thanks!
.
- Follow-Ups:
- Re: Reading blocks of data from socket
- From: Phil Frisbie, Jr.
- Re: Reading blocks of data from socket
- Prev by Date: Re: IOCP issue
- Next by Date: Re: Reading blocks of data from socket
- Previous by thread: Bluetooth Help required.
- Next by thread: Re: Reading blocks of data from socket
- Index(es):
Relevant Pages
|