X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/c781f79f3c8cb9a7577ee1574d196988da2719b3..496569ab5b179932c60b2924bf4c61176c8be004:/daemon.go?ds=sidebyside diff --git a/daemon.go b/daemon.go index 9f71d80..ea25318 100644 --- a/daemon.go +++ b/daemon.go @@ -44,9 +44,9 @@ type DaemonClient struct { once sync.Once } -// Accept serves each client of listener until the listener closes. A new -// client gets a ready event with the name of the agent, and a busy event when a -// turn runs. +// Accept serves each client of listener until the listener closes. A new client +// gets a ready event with the name of the agent, and a busy event when a turn +// runs. func (h *DaemonHub) Accept(ctx context.Context, listener net.Listener, l *TurnLoop) { for { conn, err := listener.Accept() @@ -167,8 +167,8 @@ func (h *DaemonHub) send(client *DaemonClient, event Event) { } } -// remove removes client, closes its connection, and ends its writer. The -// caller holds the mutex. +// remove removes client, closes its connection, and ends its writer. The caller +// holds the mutex. func (h *DaemonHub) remove(client *DaemonClient) { delete(h.clients, client) client.once.Do(func() {