I'm assuming that the TCP ports are linked to an application you have created. In which case, I would suggest this is caused by the way the application is handling the data it's receiving or more specifically its not handling it and this is causing the application to crash. Added additional checks to the code to verify the data being received and that all buffer length variables are double checked and packets are dropped if any data is invalid.
If the application is provided by a third party, then you should raise a support call with them for an update to fix the problem.
Gary.