Re: Reading blocks of data from socket
- From: "Dilip" <rdilipk@xxxxxxxxx>
- Date: 10 Jul 2006 13:57:15 -0700
Phil Frisbie, Jr. wrote:
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.
Just took a look at your website. Wish I had seen it earlier.. your
network library would've come in handy. Thanks for validating my
approach though...
.
- Follow-Ups:
- Re: Reading blocks of data from socket
- From: Arkady Frenkel
- Re: Reading blocks of data from socket
- References:
- Reading blocks of data from socket
- From: Dilip
- Re: Reading blocks of data from socket
- From: Phil Frisbie, Jr.
- Reading blocks of data from socket
- Prev by Date: Re: Reading blocks of data from socket
- Next by Date: Socket.BeginReceiveFrom gives multiple callbacks
- Previous by thread: Re: Reading blocks of data from socket
- Next by thread: Re: Reading blocks of data from socket
- Index(es):
Relevant Pages
|