APPENDIX
else{
nErrorStatus=WSAGetLastError();
switch(error_kind){
case ERROR_SOCKET:
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 - 25
printf("Failed to create socket.");
break;
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-Q
// Procesamiento de apagado
// Procesamiento de cierre
// Señalizador de finalización de
// conexión apagado
// Espere para un ingreso de clave
// Libere el Winsock.DLL
App - 25