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

start-process in epc:start-server #17

Open
ustcscgy opened this issue Mar 7, 2014 · 11 comments
Open

start-process in epc:start-server #17

ustcscgy opened this issue Mar 7, 2014 · 11 comments

Comments

@ustcscgy
Copy link

ustcscgy commented Mar 7, 2014

start-process mixes stdout and stderr, so a warning may come before the port-str, and causes a false error to raise.

@kiwanami
Copy link
Owner

kiwanami commented Mar 9, 2014

Yes. I think this is a problem too.
Should epc provide new function for starting server with the specified port number?
Or epc should read the port number from the mixed output cleverer...
Do you have any idea?

@ustcscgy
Copy link
Author

ustcscgy commented Mar 9, 2014

I think epc should read more lines from output and port number in output should use a fixed format other than just a number.

@tkf
Copy link
Contributor

tkf commented Mar 9, 2014

Finding some specific format in a stream is a complex task. How about reading port from a file (add an option to do that)? This way it also makes it easier to connect a same peer from different processes.

@ustcscgy
Copy link
Author

Yes, that's better.

@kiwanami
Copy link
Owner

@tkf and @ustcscgy, thank you for your idea.
I would make some code that epc processes pass the port number via the file.

But, I have not much time to implement now (in this month...).
If you send a pull-request, it's welcome.

@ustcscgy
Copy link
Author

The print_port function is in python-epc, although it provides a second argument to write the port number in a file, but emacs packages which use python-epc will probably print to stdout.

For the same reason, change port number format is problematic. So unless emacs-epc and python-epc change at the same time, we have to risk the change that epc:start-server will get wrong number from first few lines of stdout/stderr mixture.

@tkf
Copy link
Contributor

tkf commented Mar 10, 2014

@ustcscgy You can use cat as a fake server command. Actually this is how I debug server. http://tkf.github.io/emacs-jedi/latest/#jedi:toggle-debug-server

@kiwanami
Copy link
Owner

@ustcscgy Yes, we should care about the difficulty with changing at the same time.
Use may get wrong packages which communicate by incompatible protocol.
I will make those changes at another branch and perform experiences.

@tkf, your method is great. And I'm sorry that epc has been hard to debug...

@tkf
Copy link
Contributor

tkf commented Mar 11, 2014

No, EPC is easy to debug! With this cat method you can drop in all kind of Python debugger in terminal. This is really great!

@ustcscgy
Copy link
Author

An idea came to me yesterday:
How about using sh to redirect stderr to a file and when the first line of stdout is not a number, give error message from the file.

@kiwanami
Copy link
Owner

@tkf, that's good news for me.

@ustcscgy, @tkf
Yes, sh and cat methods are useful for unix-like environment.
I wonder windows users also have this mixture problem?

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

No branches or pull requests

3 participants