private void closeConnection(WebSocketConnection ws)
 {
     Log($"Closing connection to peer: {ws}");
     Sockets.Remove(ws);
 }
 private async Task WriteAsync(WebSocketConnection ws, string message)
 {
     Log($"[Writing message]: {message}");
     await ws.SendAsync(message);
 }
 private void initErrorHandler(WebSocketConnection ws)
 {
     ws.onClose = () => closeConnection(ws);
     ws.onError = () => closeConnection(ws);
 }