I guess the port is becoming too busy to send/receive any data.
I would suggest you to wait for few seconds after sending some messages (say 10 or 15). So do something like this:
for (int i = 0; i < messageCount; i++)
{
if (i % 15 == 0)
{
System.Threading.Thread.Sleep(10000);
}
}
Here after every 15 messages I am stopping the processing for 10 seconds.
I hope you got the idea. Try this and let me know if it helps. :thumbsup: