Fix the telnet connection on Windows
This pull request should fix the bug reported in issue #698 and discussion #693:
- Error codes returned by
socket()andappend()should now be correctly handled on Windows (theSOCKETtype is a pointer type). - JSBSim no longer expects
telnetto be in line mode. Actually, the defaulttelneton Windows cannot be set to line mode sorecv()sends one character at a time instead of a string. This PR modifiesFGInputSocketto append the data received from the socket in a buffer. The buffer is parsed once it contains a CARRIAGE RETURN\ror a LINE FEED\n.
As per @seanmcleod's suggestion, dummy flags INVALID_SOCKET and SOCKET_ERROR are defined for non-Windows platforms to use the same syntax for all platforms and save a lot of #ifdef.
I took the opportunity of this PR to fix the test TestInputSocket so that it should now work on Windows and MacOSX.
I removed the threading code altogether as this was not needed and the test is now taking place in a single thread. The resulting code is much more straightforward and achieves the goal of testing whether the input socket is working or not on the 3 platforms that we are supporting (instead of Linux alone).