C
Cool Guy
Oh dear, I've gotten myself into a right mess.
The other day my application (one that serves files through sockets) was
opening the file, reading the full contents into memory, then sending that
file to the client.
This cause major system slowdown due to misuse of RAM.
So I rewrote the app to read and send bits of a file at a time, but now I
have another problem: I can't have more than one file open at one time.
How could I get around this?
P.S. I'm using FileStream.
Illustration of the problem:
Client1 requests file X.
....start sending file X...
Client2 requests file X.
....error because it's already open for sending to Client1...
Any help would be very much appreciated.
The other day my application (one that serves files through sockets) was
opening the file, reading the full contents into memory, then sending that
file to the client.
This cause major system slowdown due to misuse of RAM.
So I rewrote the app to read and send bits of a file at a time, but now I
have another problem: I can't have more than one file open at one time.
How could I get around this?
P.S. I'm using FileStream.
Illustration of the problem:
Client1 requests file X.
....start sending file X...
Client2 requests file X.
....error because it's already open for sending to Client1...
Any help would be very much appreciated.