It's probably a timeout problem: start by looking at your code - we can't do that for you, we don't have it - and look for timeouts you can extend.
Socket Class (System.Net.Sockets) | Microsoft Docs[
^]
It's probably either the ReceiveTimeout or the SendTimeout, but you'll probably need to measure the time it's taking and establish a worse case before you start playing or ot'll come back later at an importune moment.