So what happens when the network cable gets unplugged, or the network goes down, etc?
Posts by oneslyfox
-
-
Well this is for cases when the network cable gets unplugged, it can't seem to reconnect without aborting the program and restarting. I have no problems with staying connected normally.
How do you change the inactivity timeout to 0?
-
-
I have a KAREL program for socket messaging between the robot and a PC. The program itself works fine, but I'm having an issue where, if the network cable gets disconnected then reconnected, the program can't recover. It tries to connect (MSG_CONNECT), but fails with a status of 67215. Below is the routine it gets stuck in. It just loops around RetryConnect:: until I kill the program and run it from the beginning. What doesn't make sense is that this Routine is the first thing that runs just after a few lines that resets some temporary variables, so there shouldn't be anything different when I run this after hitting Abort All, but network communications don't always make sense.
Any help is appreciated!
BEGIN
WRITE('Connecting...', CR)
RetryConnect::
SET_FILE_ATR(file_var, ATR_IA)
-- set the server port before doing a connect
SET_VAR(entry, '*SYSTEM*', '$HOSTS_CFG[3].$SERVER_PORT', 59003, STATUS)
-- Connect to server.
MSG_CONNECT('S3:',STATUS)
IF (STATUS > 0) THEN
IF (STATUS = 67215) THEN
MSG_DISCO('S3:', STATUS)
GOTO RetryConnect
else
WRITE('Connect Status = ', STATUS, CR)
RETURN(FALSE)
ENDIF
ENDIF
WRITE('Connection Established', CR)
RETURN(TRUE)
END Connect_Serv