Re: Reading blocks of data from socket
- From: "Phil Frisbie, Jr." <phil@xxxxxxxxxxxx>
- Date: Mon, 10 Jul 2006 13:42:57 -0700
Dilip wrote:
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?
That is how I do it.
--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
.
- Follow-Ups:
- Re: Reading blocks of data from socket
- From: Dilip
- Re: Reading blocks of data from socket
- References:
- Reading blocks of data from socket
- From: Dilip
- Reading blocks of data from socket
- Prev by Date: Reading blocks of data from socket
- Next by Date: Re: Reading blocks of data from socket
- Previous by thread: Reading blocks of data from socket
- Next by thread: Re: Reading blocks of data from socket
- Index(es):
Relevant Pages
|