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

Unable to connect in packaged electron app #95

Open
lzkelley opened this issue Jan 2, 2018 · 4 comments
Open

Unable to connect in packaged electron app #95

lzkelley opened this issue Jan 2, 2018 · 4 comments

Comments

@lzkelley
Copy link

lzkelley commented Jan 2, 2018

When my electron application in a development environment, zerorpc works perfectly and my javascript code communicated well with a background python process. When I package the application as a mac app, however, zerorpc is unable to connect and I eventually get a Lost remote error.

This problem is at the interface of zerorpc and electron, but I'm wondering if anyone on this side has any suggestions, or even ideas on where to start debugging... Unfortunately I'm new to Node and js as a whole.

Could it be some sort of (permissions?) issue with access to tcp or the local port when running as an app? Thanks!

  • node 6.11.5

  • electron 1.8.1

  • zerorpc 0.9.7

  • zmq 2.15.3

  • MacOS 10.12.6


Edits:

    1. The python process is initially launched (based on logging the result of require('child_process').spawn('python', [pyPath, port]);)
    1. If I manually run my python backend from the command line, then the electron front-end is able to communicate with it properly.

So I guess this suggestions that either A) the python process is terminating immediately (or soon) after launching; or B) for some reason the communication is failing specifically with the internally launched python process...

@MichaelScript
Copy link
Contributor

It looks like you have to use a different API than the one Zmq uses (which can't be fixed by 0rpc), see: https://stackoverflow.com/questions/41674063/is-it-possible-to-create-a-tcp-client-with-electron

Either way I don't believe this is something that can be fixed within the ZeroRPC repo as it's sockets come from https://github.com/JustinTulloss/zeromq.node

@lzkelley
Copy link
Author

Thanks @MichaelScript I'll try looking into monkey-patching something to test this....
It's still also possible it's an issue with spawning the python process specifically in a packaged app (i.e. a problem unrelated to zerorpc-node). I'll update if I find anything.

@sunhwan
Copy link

sunhwan commented Feb 21, 2018

Maybe this helps? fyears/electron-python-example#8

@Rachana-dot
Copy link

Rachana-dot commented Jun 30, 2022

Hello,
Any Update on the solution, I have been having same issue for some time?

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

4 participants