CanonicalLtd / UCWifiConnect

The code of this project has been moved to https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect
GNU General Public License v3.0
2 stars 2 forks source link

Server status #37

Closed rmescandon closed 7 years ago

rmescandon commented 7 years ago

Fixes #29 Code has been changed to separate server status from current available server. This lets us even add easily other different portals if needed, or add/remove server statuses easily.

Vars to check now are:

While starting any server a goroutine checks if the server is already started (by telnet host:port) and moves state from Starting to Running when available. Server starts asynchronously, so that if you check state just after listenAndServe() call, maybe you still don't get desired server status as it is still in startup process. In case you want main thread to wait for certain server state, there is a server.WaitForState() available method

A bunch of new tests have been added to verify the correct state after valid or invalid transitions.

rmescandon commented 7 years ago

Comments addressed