{"action":"created","issue":{"url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/43","repository_url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket","labels_url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/43/comments","events_url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/43/events","html_url":"https://github.com/IBM-Swift/Kitura-WebSocket/pull/43","id":335182647,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2OTUxOTYx","number":43,"title":"Add a lastFrameReceivedAt timestamp so that dead connections can be detected","user":{"login":"bridger","id":1337793,"node_id":"MDQ6VXNlcjEzMzc3OTM=","avatar_url":"https://avatars2.githubusercontent.com/u/1337793?v=4","gravatar_id":"","url":"https://api.github.com/users/bridger","html_url":"https://github.com/bridger","followers_url":"https://api.github.com/users/bridger/followers","following_url":"https://api.github.com/users/bridger/following{/other_user}","gists_url":"https://api.github.com/users/bridger/gists{/gist_id}","starred_url":"https://api.github.com/users/bridger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridger/subscriptions","organizations_url":"https://api.github.com/users/bridger/orgs","repos_url":"https://api.github.com/users/bridger/repos","events_url":"https://api.github.com/users/bridger/events{/privacy}","received_events_url":"https://api.github.com/users/bridger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-24T14:14:21Z","updated_at":"2018-06-29T02:53:13Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/pulls/43","html_url":"https://github.com/IBM-Swift/Kitura-WebSocket/pull/43","diff_url":"https://github.com/IBM-Swift/Kitura-WebSocket/pull/43.diff","patch_url":"https://github.com/IBM-Swift/Kitura-WebSocket/pull/43.patch"},"body":"This feature allows a server to detect when a websocket has gone stale. It is to fix #24.\r\n\r\nHere is an example of how my server uses this API to cleanup old connections:\r\n\r\n```\r\n    func _connectionKeepAliveAndCleanup() {\r\n        let pingInterval: TimeInterval = 60\r\n\r\n        for connection in connections {\r\n            connection.ping()\r\n            if connection.lastFrameReceivedAt.numberOfSecondsOld > 2 * pingInterval {\r\n                connection.close(reason: .normal, description: nil)\r\n                self.disconnected(connection: connection, reason: .normal)\r\n            }\r\n        }\r\n\r\n        readWriteQueue.asyncAfter(deadline: DispatchTime.now() + pingInterval) {\r\n            self._connectionKeepAliveAndCleanup()\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/comments/401232138","html_url":"https://github.com/IBM-Swift/Kitura-WebSocket/pull/43#issuecomment-401232138","issue_url":"https://api.github.com/repos/IBM-Swift/Kitura-WebSocket/issues/43","id":401232138,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTIzMjEzOA==","user":{"login":"bridger","id":1337793,"node_id":"MDQ6VXNlcjEzMzc3OTM=","avatar_url":"https://avatars2.githubusercontent.com/u/1337793?v=4","gravatar_id":"","url":"https://api.github.com/users/bridger","html_url":"https://github.com/bridger","followers_url":"https://api.github.com/users/bridger/followers","following_url":"https://api.github.com/users/bridger/following{/other_user}","gists_url":"https://api.github.com/users/bridger/gists{/gist_id}","starred_url":"https://api.github.com/users/bridger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridger/subscriptions","organizations_url":"https://api.github.com/users/bridger/orgs","repos_url":"https://api.github.com/users/bridger/repos","events_url":"https://api.github.com/users/bridger/events{/privacy}","received_events_url":"https://api.github.com/users/bridger/received_events","type":"User","site_admin":false},"created_at":"2018-06-29T02:53:13Z","updated_at":"2018-06-29T02:53:13Z","author_association":"CONTRIBUTOR","body":"Cool! Let's merge 🙌"}}
{"actor":{"display_login":"bridger"}}