Is 300456 the port? If so, ports can only be in the range 1 to 65534. (Similar to the range of an unsigned short, but with the highest and lowest values reserved for reporting errors)
The server is and embedded Unix system.
The client is a Windows 7 PC.
I'm 100% sure the servers (there are 5 identical ones) are configured properly and it would be difficult to replicate them on the PC.
Turns out I was mistaken about which environment I was running under.
Although the .exe was compiled with the Cygwin compiler, when executed it ran in the windows command window. When executed in a Cygwin window (open the window and execute from the command line) the following line of code was successful: