This is a snippet of code which sends a command to another application and awaits a reply. If it doesn't receive a reply within the `maxWait` time... it just wait's for a little longer...
Added in a commit with the message "additional checks to make sure that we got a response from sw and if not then resend the command"
```csharp
SkunkworksComm.SendGetGcExportHeader();
GCHeader tmpHeader = null;
int maxWait = 50;
int count = 0;
while (!SkunkworksComm.GcHeaderFetched)
{
Thread.Sleep(25);
count++; if (count > maxWait) break;
}
if (SkunkworksComm.GcHeaderFetched)
{
tmpHeader = SkunkworksComm.SkunkworkGcHeader;
}
else
{
count = 0;
while (!SkunkworksComm.GcHeaderFetched)
{ Thread.Sleep(25);
count++; if (count > maxWait)
break;
} if (SkunkworksComm.GcHeaderFetched)
{ tmpHeader = SkunkworksComm.SkunkworkGcHeader;
}
}
```
_This is a page in the collection of [[Chip Overflow/Willies|snippets that give me the willies]]_