Hi to all,
I wrote a simple client-server application that comunicate through NetworkStream class. The problems comes when stream.close() and client.close() methods are called. It look like only the first 10415 bytes are sent once those methods are called. So, if the data to send is more than this size, it is automatically truncated.
If I remove both stream/client close() methods from the code, the data is fully received whatever the size is. I tried various alternative solutions (the ones marked as comments in the sample code), but none of them works.
The only thing that seems to work is adding a manual delay before the close() methods execute with something like that:
For Counter as integer = 0 to 10
The problem is that after delay I still don't know if all the data has been transfered or not. In addition to that, I will have to wait 10 seconds before sending another request, even if the response is just a few bytes of data. I could change at runtime the number of seconds to wait according to the size of the data to send, but I still think that delay is not a solution and will cause adverse effects.
So, for now the only working solution is to remove both Stream/Client Close() methods from
View Complete Post