7Appendix
Real-time external control function
Appendix-607
retry--;// No. of retries subtraction
if(retry==0) loop=0; // End program if No. of retries is 0
}
} /* while(retry) */
} /* while(loop) */
// End
cout << "/// End /// ";
sprintf(buf, "counter = %ld", counter);
cout << buf << endl;
//Close socket
status=closesocket(destSocket);
if (status == SOCKET_ERROR)
cerr << "ERROR: closesocket unsuccessful" << endl;
status=WSACleanup();
if (status == SOCKET_ERROR)
cerr << "ERROR: WSACleanup unsuccessful" << endl;
return 0;
}