Comments (12)
Yes, in case of different applications you can change the port by the configuration.py file. But maybe we can enable the library on finding automatically the best port number.
from remi.
yes I know I can change it, but what if I want to launch the same app with the same source code twice?
you can do something like this to get a random free port
server = TCPServer(('127.0.0.1', 0), Handler)
host, port = server.socket.getsockname()[:2]
print "we are on port", port
from remi.
Fine, I will do this soon. ;-)
from remi.
If you are going to do this please make it optional. I intend to autostart the server when the Pi is powered up and a terminal window will not be open to see the port number that is printed.
The solution could be that if the port is left blank in configuration.py then a port is automatically selected. Presumably something will need to be done for the websocket port as well.
from remi.
The websocket port is an implementation detail. it should always be an ephemeral port
IMO, the default behaviour should be to just work - i.e. both ports should be ephemeral and random. Hardcoded ports should be optional unless you are targeting the framework to be used by only one app at a time...
from remi.
A great solution could be listen on default port (from code / configuration file) and, when already used, switch to random port
from remi.
I'm working on this, and cleaning up the whole configuration system, in https://github.com/nzjrs/gui/tree/multiple-instance
from remi.
Ok John, but take care about the parameter MULTIPLE_INSTANCE in configuration.py file. This parameter changes the behavior of the server in case of multiple clients to the same App. If True, multiple instances of App class are created. If False instead, all the clients shares the same App class instance.
from remi.
Thanks, it was a bit confusing!
What would be a reason to run MULTIPLE_INSTANCE=True? I can't think of a use at the moment
from remi.
Image a collaborative App, multiple user can interact on the same interface.. I do not have a specific use case now.
from remi.
A simple address book application, with a name/surname filter: when someone change the filter, this one shouldn't be shared with other clients.
from remi.
A simple address book application, with a name/surname filter: when someone change the filter, this
one shouldn't be shared with other clients.
how is the author of such an app expected to know which client they are talking to, and should they care? is it expected that you poke around in self.client_address from main? are all apps otherwise destined to be stateless?
I get the intention, but I wonder if the current implementation has been well considered.
from remi.
Related Issues (20)
- got an unexpected keyword argument 'websocket_port HOT 1
- Blank window on standalone_app.py HOT 2
- Labels do not display the correct number of whitespace HOT 1
- [QUESTION] any example of long-polling implementation in remi? HOT 1
- Get selected text from TextInput HOT 6
- automatic scroll down in text widget (write only) HOT 9
- highlight of table cells in front end. HOT 1
- GenericDialog confirm by Enter key pressing HOT 1
- 2 bugs remain for python 3.10 HOT 1
- How to add a radiobox or radiogroup in remi? HOT 1
- How to insert custom HTML
- Javascript gets unloaded after remi reloads with "handshake complete" HOT 3
- Add a button that opens a link HOT 2
- Feature request: Allow setting button labels on GenericDialog
- Editor: export do not work correctlly HOT 1
- Termux Version?
- Offline Plotly HTML Integration HOT 1
- Editor directory conflicts with other packages
- [Question] How can I find all the local partitions when working with gui.FileSelectionDialog widget? HOT 3
- Race condition when building single instance App gui
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remi.