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