You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to send any other commands from the controller while interacting with the one of the clients I get this error:
[SERVER - ERROR] Client closed the connection
[INFO] Retreiving connections again...
The only commands that work successfully are the ones that are the "CD" and "quit" commands listed before the else statement here:
else:
allConnections[chosenone].send(data)
msg = allConnections[chosenone].recv(20480)
sendController(msg, q)
if (sendController(msg, q) == 0):
breakit = True
break
I have narrowed the error to its origin somewhere in that block of code, but I cannot find anything wrong with this code.
I am running the client, server, and controller from separate Windows machines. If someone could please help me out that would be great. Thanks!
Upon further investigation the client is closing causing the controller to break. the line of code that is causing this issue is the "signal.signal(signal.SIGALRM, alarm_handler)" line in this block.
Activity
dtraboulsi24 commentedon Aug 31, 2016
Upon further investigation the client is closing causing the controller to break. the line of code that is causing this issue is the "signal.signal(signal.SIGALRM, alarm_handler)" line in this block.
thecommand = ' '.join(commands)
comm = subprocess.Popen(thecommand, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
signal.signal(signal.SIGALRM, alarm_handler)
signal.alarm(30)
try:
STDOUT, STDERR = comm.communicate()
en_STDERR = bytearray(STDERR)
en_STDOUT = bytearray(STDOUT)
if (en_STDERR == ""):
if (en_STDOUT != ""):
print en_STDOUT
s.send(en_STDOUT)
else:
s.send("[CLIENT] Command Executed")
else:
print en_STDERR
s.send(en_STDERR)
sayak-brm commentedon Jan 4, 2017
Quoting from https://support.sas.com/documentation/onlinedoc/sasc/doc750/html/lr1/zsigalrm.htm:
sayak-brm commentedon Jan 5, 2017
Well, it seems that the above has nothing to do with this error.
@dtraboulsi24 Are you on Windows?
Because in Windows, the
SIGALRMattribute is not present in thesignalmodule.