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);
}
Содержание Trakker Antares 2460
Страница 1: ...Trakker Antares 246X Stationary Terminal User s Manual...
Страница 4: ...blank page...
Страница 19: ...Introducing the 246X Stationary Terminal 1...
Страница 20: ...blank page...
Страница 29: ...Installing the Terminal 2...
Страница 30: ...blank page...
Страница 47: ...Configuring the Terminal 3...
Страница 48: ...blank page...
Страница 58: ...blank page...
Страница 59: ...Operating the Terminal in a Network 4...
Страница 60: ...blank page...
Страница 88: ...blank page...
Страница 89: ...Programming the Terminal 5...
Страница 90: ...blank page...
Страница 107: ...Troubleshooting 6...
Страница 108: ...blank page...
Страница 121: ...Reader Command Reference 7...
Страница 122: ...blank page...
Страница 149: ...Configuration Command Reference 8...
Страница 150: ...blank page blank page...
Страница 242: ...blank page blank page...
Страница 243: ...Specifications A...
Страница 244: ...blank page blank page...
Страница 257: ...Full ASCII Charts B...
Страница 258: ...blank page blank page...
Страница 267: ...Using the Default Applications C...
Страница 268: ...blank page blank page...
Страница 279: ...Index I...
Страница 280: ...blank page...
Страница 290: ...body text 4...