I did all this coding and now it doesn't work!.
Here are some items that may help.
First, the sample project (that you received by email ) contains a ReadMe file that may
Second, both the client and the server programs in the sample project provide command
line help. In a command prompt window type:
for help on using the server program or
for help on using the client program.
Third, the error code for socket calls is expanded in Microsoft's Winsock.h header
file. All socket error codes are numbered relative to WSABASEERR (= 10000). For example if
the error code is 10061 then look for WSABASEERR+61 in Winsock.h and find:
#define WSAECONNREFUSED (WSABASEERR+61)
Then look up the documentation for the failing API call to find out what
WSAECONNREFUSED means in the context of the call. I know this sounds obvious, but it
wasn't obvious to me when I first used Windows sockets (I was looking for the wrong string
in the wrong header file..... in Unix errno.h was all we needed). By the way,
WSAECONNREFUSED, generally means that the connection was refused because ADRSockSrv is not
running on the computer that we tried to connect with. Either start ADRSockSrv or fix the
Hosts file to point at the correct IP address.
Fourth, check the other documentation on this web site to ensure that your serial port
is configured OK and that the ADR card is connected and powered properly.
Note that Ontrak will not provide support for this tutorial as it is provided only as a
guideline for experienced programmers who wish to implement TCP/IP control systems.