-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add connection between students, presenter, and central server. #2
Conversation
Connection is the class we will use for all communications, sendMessage and registerMessageListener are the two methods we will be using most frequently.
Awesome. What do I need to get done? On Saturday, April 26, 2014, Josh Terrell [email protected] wrote:
Michael J. Sevilla |
@mjsevilla If you are working on anything that needs to be transmitted to other students/presenter or something that needs to be received from other students/presenter, you'll probably care about what's gong on here. Otherwise. this shouldn't change anything for you |
This adds quite a lot of stuff needed for authenticating. The public API function, Connection.authenticate, is functional. There were several hurdles along the way. One noteable one is that wx must be called in it's own thread. Both wx and reactor are event loops that need their own thread. Long story short, reactor never calls the user's callbacks; reactor adds the callbacks to a stack which is then called by wx. TODO: add a timeout to connection that responds to the user after.. a sec or so if there is no response from the server. Right now it just keeps on waiting if the server doesn't respond. start the central server from main.py or move it next to main.py handle the other public connection functions I forgot about commiting last night, my bad. This should have been broken up into several commits.
To run the server from main.py, run `python main.py server`
If the authorization request takes longer than 3 seconds to get a response, just assume it's failed.
Calling conneciton.hostPresentation(classname, callback) will attempt to host a presentation for the given class calling the callback with a HostResponse when the server has replied. (either failure or success)
1) If reactor is still running a second after we asked it to close, just kill the process rather than hanging for (literally) about a minute. 2) don't raise an exception if the user attempts to send a message in CentralClient and the connection is down.. just call the callback saying that the conneciton is down.
Connection is the class we will use for all communications,
sendMessage and registerMessageListener are the two methods we will be using
most frequently.
this is the beginning of large changes.. I'll be adding more commits as we go.
TODO: add manual timeout for pending message responses.