I am getting an error on this line:

ReceivedData = NetStream.Read(CryptData, 0, Size)

This is the information it gives me:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in System.dll

Additional information: Specified argument was out of the range of valid values.

If you could help me understand why this is happening I would be very grateful, if you need more code or information just say.

That exception would occur if Size is negative.


I can really not figure this problem out, if I sent you the source would you be able to take a look at it for me?

At the moment I seemed to have solved the problem thank you for helping.