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

Add connection between students, presenter, and central server. #2

Merged
merged 7 commits into from
Apr 28, 2014

Conversation

joshterrell805
Copy link
Member

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.

Connection is the class we will use for all communications,
sendMessage and registerMessageListener are the two methods we will be using
most frequently.
@mjsevilla
Copy link
Contributor

Awesome. What do I need to get done?

On Saturday, April 26, 2014, Josh Terrell [email protected] wrote:

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.

You can merge this Pull Request by running

git pull https://github.com/joshterrell805/EClass add-networking

Or view, comment on, or merge it at:

#2
Commit Summary

  • Add documentation for Connection

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/2
.

Michael J. Sevilla
Computer Science Undergraduate (est. June 2015)
California Polytechnic State University
San Luis Obispo, CA 93405
[email protected]

@joshterrell805
Copy link
Member Author

@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

joshterrell805 and others added 6 commits April 27, 2014 07:26
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.
@joshterrell805 joshterrell805 merged commit 9cbf33c into master Apr 28, 2014
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 this pull request may close these issues.

3 participants