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

Http server mgmt #20

Closed rmescandon closed 7 years ago

rmescandon commented 7 years ago
knitzsche commented 7 years ago

Couple minor comments in line. Cheers.

knitzsche commented 7 years ago

One last thing: can you make a func to allow checking if (either) http server is running? My daemon loops and I'd like to check status before enabling/disabling. (in daemon branch I created wifi.Enabled() bool for this purpose). OR is their a better way? cheers

knitzsche commented 7 years ago

another request: when adding capabilities that change the state of wifi-connect, we probably should always provide a command for it. Can you please add commands for starting and stopping the two http portal servers?

rmescandon commented 7 years ago

You mean having a command to switch from one portal to the other? (and another viceversa command)

On 04/04/17 18:54, knitzsche wrote:

another request: when adding capabilities that change the state of wifi-connect, we probably should always provide a command for it. Can you please add commands for starting and stopping the two http portal servers?

--

. Roberto Mier Escandón. . Software Engineer . . Canonical - Solutions Engineering

rmescandon commented 7 years ago

When starting a server, a io.Clorer is provided (not nil if the server started ok). After calling io.Closer.Close() to shutdown the server, that closer could be set to nil (by hand) for having a way of knowing the status But maybe the best should be having all this wrapped internally and provide methods returning a boolean :), yes.

On 03/04/17 21:27, knitzsche wrote:

One last thing: can you make a func to allow checking if (either) http server is running? My daemon loops and I'd like to check status before enabling/disabling. (in daemon branch I created wifi.Enabled() bool for this purpose). OR is their a better way? cheers

knitzsche commented 7 years ago

we discussed in irc, but for the record, I think we don't need switch portal command. I think we want a command to start and stop each portal, mostly useful for dev.

knitzsche commented 7 years ago

the only bit I think missing is the cmds to start and stop the servers. while not strictly required, these might be useful. Let's wait on that and merge as is.

I have not tested, but LGTM. thanks.