Intermec Trakker Antares 2410 System Manual page 48

Intermec trakker antares 2410: user guide
Hide thumbs Also See for Trakker Antares 2410:
Table of Contents

Advertisement

Chapter 2—Configuring and Managing the Terminals
Sleep(2000);
// receive the converted string from the server
memset(&rz, 0, sizeof(rz));
rcLen = sizeof(rz);
cbRecv = recv(connection, rz, rcLen, 0);
if (cbRecv < 0)
{
}
// 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);
}
28
Rcount++;
printf("receive failed %d\n", Rcount);
ErrorMessage("receive", WSAGetLastError());
bConnectionAlive = FALSE;
Trakker Antares 2400 Family System Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents