Question:

Socket Programming ==> C# ?!?!?!?

by  |  earlier

0 LIKES UnLike

I'm trying to transfer a huge amount of text through socket

so i create a a buffer

buffer = new byte[90000];

and it throws an

Exception of type 'System.OutOfMemoryException'

when i change the buffer size to 50000 it works but 50000 is not enough to transfer the required amount of text . what can i do?

 Tags:

   Report

2 ANSWERS


  1. Why not have it send the data through a loop. Read from the source into the buffer x amount of characters, send the buffer, flush the buffer and repeat.


  2. Well, it's an outofmemory exception, wouldn't that mean you're out of memory. Really. I mean 90,000 bytes is so small at the same time >.>

    Just try a variety of different things: Killing processes / tasks, seeing if you can boot in a safe mode of some sort, which usually uses many less processes than a typical mode.

    Etc. Also, C# is an extremely bulky language, in my opinion.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions