Function
closeConnection
(connection *websocket.Conn, done chan struct{}, interrupt chan os.Signal)
Source from the content-addressed store, hash-verified
| 150 | } |
| 151 | |
| 152 | func closeConnection(connection *websocket.Conn, done chan struct{}, interrupt chan os.Signal) { |
| 153 | for { |
| 154 | select { |
| 155 | case <-done: |
| 156 | return |
| 157 | case <-interrupt: |
| 158 | connection.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) |
| 159 | return |
| 160 | } |
| 161 | } |
| 162 | } |
Tested by
no test coverage detected