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

Quotes around the error reason in the tcp_server protocol are missing #37

Open
rickardraysearch opened this issue Nov 21, 2019 · 0 comments · May be fixed by #38
Open

Quotes around the error reason in the tcp_server protocol are missing #37

rickardraysearch opened this issue Nov 21, 2019 · 0 comments · May be fixed by #38

Comments

@rickardraysearch
Copy link

In the documentation for the tcp_server, the format for error messages are given as follows:

  • Given: SET_LEARNING_MODE
    * Returned error: SET_LEARNING_MODE:KO,"Incorrect number of parameter(s) given."

In the implementation, there are no quotes around the error message. This makes it impossible to detect the end of the response. That also exposes a larger problem with the protocol, which is that it is difficult to resynchronize after reading a partial message, since there are no delimiters between responses. Adding a line break after the response would greatly simplify resynchronization.

The python client assumes incorrectly that reads from a tcp socket will return full messages, and will thus break if a partial read is returned. See https://docs.python.org/3/howto/sockets.html , specifically the last 3 paragraphs of the "Using a Socket" section.

@rickardraysearch rickardraysearch linked a pull request Dec 2, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant