Skip to content

[SERVER - ERROR] Client closed the connection #2

Open

Description

@dtraboulsi24

Hello,

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!

Activity

  1. dtraboulsi24 commented on Aug 31, 2016

    @dtraboulsi24
    Author

    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)

  2. sayak-brm commented on Jan 4, 2017

    @sayak-brm

    Quoting from https://support.sas.com/documentation/onlinedoc/sasc/doc750/html/lr1/zsigalrm.htm:

    By default, SIGALRM causes the program to abnormally terminate with a user ABEND code of 1225.

  3. sayak-brm commented on Jan 5, 2017

    @sayak-brm

    Well, it seems that the above has nothing to do with this error.

    @dtraboulsi24 Are you on Windows?

    Because in Windows, the SIGALRM attribute is not present in the signal module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions