App - 13
MELSEC-F
APPENDIX
App - 13
case ERROR_BIND:
printf("Failed to bind.");
break;
case ERROR_CONNECT:
printf("Failed to establish connection.");
break;
case ERROR_SEND:
printf("Sending failed.");
break;
case ERROR_RECIEVE:
printf("Receiving failed.");
break;
case ERROR_SHUTDOWN:
printf("Failed to shutdown.");
break;
case ERROR_CLOSE:
printf("Failed to close normally.");
break;
}
}
printf("Error code is %d.\n", nErrorStatus);
if(Closeflag==FLAG_ON){
nErrorStatus=shutdown(socketno,2); // Shutdown processing
nErrorStatus=closesocket(socketno); // Close processing
Closeflag=FLAG_OFF; // Connection completion flag off
}
printf("Press any key to exit the program.\n");
Dmykeyin=getchar(); // Wait for a key input
WSACleanup(); // Release Winsock.DLL
return;
}