![]() |
|
#1
|
|||
|
|||
Buffer size in CHEllo all,
I need to declare a buffer that stores an incoming text message over the network from a server. The problem is, I dont know the length of this message. I declare my buffer as char buf[8192] for example. So right now, I read the message until the buffer gets full, and then write the contents of the buffer to a file and so on. There is an I/O involved everytime the buffer gets full. What I;d like to do is to have some sort of infinite buffer, that would store all the message. Then I can use just one I/O to write contents of buffer into a file. Is this possible to do? Thanks. |
|
#2
|
||||
|
||||
Re: Buffer size in CDoes your system have infinite memory? If so, yes. If not, there's a (somewhat) obvious limit.
What's wrong with what you've got? Does it not work? Doesn't the received buffer start with the number of bytes to be read? __________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#3
|
|||
|
|||
Re: Buffer size in Cyour buffer is one "block" of data on the disk; I'm unsure if it's possible to increase or decrease the block size some how, but you could look into that
thats about all I can help |
|
#4
|
|||
|
|||
Re: Buffer size in CWaltP ~I think he's just trying to figure out a way to minimize disk accesses, as they take ages in computer time
|
Recent GIDBlog
US Elections and the ?Voter?s Responsibility? by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 20:23 |
| Determing size of a binary file | Dream86 | C++ Forum | 7 | 01-Jun-2005 11:10 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 22:26 |
| Bounded Buffering? | pablowablo | C Programming Language | 0 | 17-Jan-2005 06:51 |
| Having a problem | Chuckles | Computer Hardware Forum | 19 | 13-Sep-2004 13:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The