(client *client)
| 104 | } |
| 105 | |
| 106 | func (a *API) register(client *client) { |
| 107 | a.lock.Lock() |
| 108 | defer a.lock.Unlock() |
| 109 | a.clients[client.userID] = append(a.clients[client.userID], client) |
| 110 | } |
| 111 | |
| 112 | // Handle handles incoming requests. First it upgrades the protocol to the WebSocket protocol and then starts listening |
| 113 | // for read and writes. |