TRAKKER Antares 246X Stationary Terminal User’s Manual
nugget
39
4-26
CLIENT.CPP Sample Application for a TCP/IP Direct Connect Network (continued)
+;
printf("receive failed %d\n", Rcount);
ErrorMessage("receive", WSAGetLastError());
bConnectionAlive = FALSE;
}
// printf the converted string
printf("response:%s\n",rz);
printf("\n> ");
Sleep(1000);
}
else
bConnectionAlive = FALSE;
}
// release the resources held by the socket
error = closesocket(connection);
if (error != 0)
ErrorMessage("closesocket", WSAGetLastError());
// release the resources held by the socket library
error = WSACleanup();
if (error != 0)
ErrorMessage("WSACleanup", WSAGetLastError());
return 0;
}
UTILS.H Utility (Used by CLIENT.CPP)
#include <windows.h>
inline void ErrorMessage(LPCTSTR szFn, DWORD dwError = GetLastError())
{
TCHAR szTitle[1024];
TCHAR szPrompt[1024];
BOOL bRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
0, dwError,
0,
szPrompt,
sizeof(szPrompt),
0);
if (!bRet)
lstrcpy(szPrompt, __TEXT("Unknown Error"));
wsprintf(szTitle, __TEXT("%s failed with error code (0x%x)!"), szFn, dwError);
int id = MessageBox(HWND_DESKTOP, szPrompt, szTitle,
MB_ABORTRETRYIGNORE|MB_SETFOREGROUND);
if (id != IDIGNORE)
ExitProcess(0);
}
Summary of Contents for Trakker Antares 2460
Page 1: ...Trakker Antares 246X Stationary Terminal User s Manual...
Page 4: ...blank page...
Page 19: ...Introducing the 246X Stationary Terminal 1...
Page 20: ...blank page...
Page 29: ...Installing the Terminal 2...
Page 30: ...blank page...
Page 47: ...Configuring the Terminal 3...
Page 48: ...blank page...
Page 58: ...blank page...
Page 59: ...Operating the Terminal in a Network 4...
Page 60: ...blank page...
Page 88: ...blank page...
Page 89: ...Programming the Terminal 5...
Page 90: ...blank page...
Page 107: ...Troubleshooting 6...
Page 108: ...blank page...
Page 121: ...Reader Command Reference 7...
Page 122: ...blank page...
Page 149: ...Configuration Command Reference 8...
Page 150: ...blank page blank page...
Page 242: ...blank page blank page...
Page 243: ...Specifications A...
Page 244: ...blank page blank page...
Page 257: ...Full ASCII Charts B...
Page 258: ...blank page blank page...
Page 267: ...Using the Default Applications C...
Page 268: ...blank page blank page...
Page 279: ...Index I...
Page 280: ...blank page...
Page 290: ...body text 4...