This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
My test server program receives packets from the Client. Im my server program the data received is assigned to:
When my client is set to continually send a message, eventually (only after a few seconds) the server throws an ArrayIndexOutOfBoundsException Error.
I assume the data[] doesn't get cleared and is filled very quickly. I would have thought that, because the data array is declared and initialized inside the for loop, the garbage collector would take care of it.
Hre is an expanded code. I'll use values instead of variable names, where possible for clarity. I have opted not to show the exception clauses as it will only clog up the code.
Can you please post the exact error message? It will include the line of code that is throwing the exception. This will greatly help us be able to determine what the problem might be.