Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When sending invalid text, app does not close the socket #31

Closed
sisoe24 opened this issue Aug 16, 2024 · 1 comment · Fixed by #33
Closed

When sending invalid text, app does not close the socket #31

sisoe24 opened this issue Aug 16, 2024 · 1 comment · Fixed by #33
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sisoe24
Copy link
Owner

sisoe24 commented Aug 16, 2024

When sending invalid text, such as code that cannot be resolved, the application does not close the socket until the client stops the process. I am not sure if this is a fault of the nukeserversocket or the clients.

Connection with broken text

[09:42:09] DEBUG    - New connection.
[09:42:09] DEBUG    - Pending connection.
[09:42:09] DEBUG    - Socket connected.
[09:42:09] INFO     - Received data from client.
[09:42:09] DEBUG    - Socket ready.
[09:51:03] DEBUG    - Received data: {'file': 'test.py', 'text': 'import random\nbroken', 'formatText': '1'}
[09:51:03] DEBUG    - Running script: test.py
... HANG (probably waits for timeout)
[09:42:18] ERROR    - Socket error: PySide2.QtNetwork.QAbstractSocket.SocketError.RemoteHostClosedError

Valid connection

[09:47:17] DEBUG    - New connection.
[09:47:17] DEBUG    - Pending connection.
[09:47:17] DEBUG    - Socket connected.
[09:47:17] INFO     - Received data from client.
[09:47:17] DEBUG    - Socket ready.
[09:47:17] DEBUG    - Received data: {'text': 'from __future__ import print_function;    print("Hostname: DESKTOP-F53A6QP User: virgilsisoe");    print("Connected to host: 127.0.0.1 port: 54321");    print("10 * 2 =", 20)', 'file': 'tmp_file', 'formatText': '1'}
[09:47:17] DEBUG    - Running script: tmp_file
[09:47:17] DEBUG    - Formatting output: [09:47:17 NukeTools] tmp_file\nHostname: DESKTOP-F53A6QP User: virgilsisoe\nConnected to host: 127.0.0.1 port: 54321\n10 * 2 = 20\n
[09:47:17] DEBUG    - Clearing output.
[09:47:17] INFO     - Writing output to back socket...
[09:47:17] DEBUG    - Output: [09:47:17 NukeTools] tmp_file\nHostname: DESKTOP-F53A6QP User: virgilsisoe\nConnected to host: 127.0.0.1 port: 54321\n10 * 2 = 20\n
[09:47:17] DEBUG    - Socket closed.
@sisoe24 sisoe24 added the bug Something isn't working label Aug 16, 2024
@sisoe24 sisoe24 self-assigned this Aug 17, 2024
@sisoe24 sisoe24 added this to the 1.0.1 milestone Aug 18, 2024
@sisoe24
Copy link
Owner Author

sisoe24 commented Aug 18, 2024

This problem seems to occur only when testing nukeserversocket locally with the exec function, so this is not a big deal. Placing a try and catch around the exec should solve the issue.

exec(self.input_editor.toPlainText())

sisoe24 added a commit that referenced this issue Aug 18, 2024
@sisoe24 sisoe24 mentioned this issue Aug 18, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant