{"action":"created","comment":{"url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/comments/174410869","pull_request_review_id":103758979,"id":174410869,"diff_hunk":"@@ -351,14 +368,47 @@ public function writeFrame(Frame $stompFrame)\n         if (!$this->isConnected()) {\n             throw new ConnectionException('Not connected to any server.', $this->activeHost);\n         }\n-        $data = $stompFrame->__toString();\n-        if (@fwrite($this->connection, $data, strlen($data)) !== strlen($data)) {\n-            throw new ConnectionException('Was not possible to write frame!', $this->activeHost);\n-        }\n+        $this->writeData($stompFrame->__toString(), $this->writeTimeout);\n         $this->observers->sentFrame($stompFrame);\n         return true;\n     }\n \n+    /**\n+     * Write passed data to the stream, respecting passed timeout.\n+     *\n+     * @param string $data\n+     * @param int    $timeout in seconds\n+     * @throws ConnectionException\n+     */\n+    private function writeData($data, $timeout)\n+    {\n+        $offset = 0;\n+        $size = strlen($data);\n+        $lastByteTime = microtime(true);","path":"src/Network/Connection.php","position":112,"original_position":55,"commit_id":"fbeee3808b1fa4b5c608490604dc80b3e1bd998f","original_commit_id":"fbeee3808b1fa4b5c608490604dc80b3e1bd998f","user":{"login":"staabm","id":120441,"avatar_url":"https://avatars2.githubusercontent.com/u/120441?v=4","gravatar_id":"","url":"https://api.github.com/users/staabm","html_url":"https://github.com/staabm","followers_url":"https://api.github.com/users/staabm/followers","following_url":"https://api.github.com/users/staabm/following{/other_user}","gists_url":"https://api.github.com/users/staabm/gists{/gist_id}","starred_url":"https://api.github.com/users/staabm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staabm/subscriptions","organizations_url":"https://api.github.com/users/staabm/orgs","repos_url":"https://api.github.com/users/staabm/repos","events_url":"https://api.github.com/users/staabm/events{/privacy}","received_events_url":"https://api.github.com/users/staabm/received_events","type":"User","site_admin":false},"body":"shouldn't this be inside the loop?","created_at":"2018-03-14T10:19:58Z","updated_at":"2018-03-14T10:19:58Z","html_url":"https://github.com/stomp-php/stomp-php/pull/107#discussion_r174410869","pull_request_url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/comments/174410869"},"html":{"href":"https://github.com/stomp-php/stomp-php/pull/107#discussion_r174410869"},"pull_request":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107","id":171769151,"html_url":"https://github.com/stomp-php/stomp-php/pull/107","diff_url":"https://github.com/stomp-php/stomp-php/pull/107.diff","patch_url":"https://github.com/stomp-php/stomp-php/pull/107.patch","issue_url":"https://api.github.com/repos/stomp-php/stomp-php/issues/107","number":107,"state":"open","locked":false,"title":"fix broken connection handling","user":{"login":"jmglsn","id":1116755,"avatar_url":"https://avatars0.githubusercontent.com/u/1116755?v=4","gravatar_id":"","url":"https://api.github.com/users/jmglsn","html_url":"https://github.com/jmglsn","followers_url":"https://api.github.com/users/jmglsn/followers","following_url":"https://api.github.com/users/jmglsn/following{/other_user}","gists_url":"https://api.github.com/users/jmglsn/gists{/gist_id}","starred_url":"https://api.github.com/users/jmglsn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmglsn/subscriptions","organizations_url":"https://api.github.com/users/jmglsn/orgs","repos_url":"https://api.github.com/users/jmglsn/repos","events_url":"https://api.github.com/users/jmglsn/events{/privacy}","received_events_url":"https://api.github.com/users/jmglsn/received_events","type":"User","site_admin":false},"body":"This enables non-blocking stream operations and replaces `stream_get_line` with `fread`. As the the previous code failed to recognize that the broker connection was dropped.\r\n\r\nThis solves #104.","created_at":"2018-02-27T20:00:59Z","updated_at":"2018-03-14T10:19:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17e14ae566e63120c2933a9cfeba6f2e31155b7c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"aelrazek","id":21688600,"avatar_url":"https://avatars3.githubusercontent.com/u/21688600?v=4","gravatar_id":"","url":"https://api.github.com/users/aelrazek","html_url":"https://github.com/aelrazek","followers_url":"https://api.github.com/users/aelrazek/followers","following_url":"https://api.github.com/users/aelrazek/following{/other_user}","gists_url":"https://api.github.com/users/aelrazek/gists{/gist_id}","starred_url":"https://api.github.com/users/aelrazek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aelrazek/subscriptions","organizations_url":"https://api.github.com/users/aelrazek/orgs","repos_url":"https://api.github.com/users/aelrazek/repos","events_url":"https://api.github.com/users/aelrazek/events{/privacy}","received_events_url":"https://api.github.com/users/aelrazek/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107/commits","review_comments_url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107/comments","review_comment_url":"https://api.github.com/repos/stomp-php/stomp-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stomp-php/stomp-php/issues/107/comments","statuses_url":"https://api.github.com/repos/stomp-php/stomp-php/statuses/fbeee3808b1fa4b5c608490604dc80b3e1bd998f","head":{"label":"fin-sn-de:bugfix/104-fix-broken-connection-handling","ref":"bugfix/104-fix-broken-connection-handling","sha":"fbeee3808b1fa4b5c608490604dc80b3e1bd998f","user":{"login":"fin-sn-de","id":5948091,"avatar_url":"https://avatars2.githubusercontent.com/u/5948091?v=4","gravatar_id":"","url":"https://api.github.com/users/fin-sn-de","html_url":"https://github.com/fin-sn-de","followers_url":"https://api.github.com/users/fin-sn-de/followers","following_url":"https://api.github.com/users/fin-sn-de/following{/other_user}","gists_url":"https://api.github.com/users/fin-sn-de/gists{/gist_id}","starred_url":"https://api.github.com/users/fin-sn-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fin-sn-de/subscriptions","organizations_url":"https://api.github.com/users/fin-sn-de/orgs","repos_url":"https://api.github.com/users/fin-sn-de/repos","events_url":"https://api.github.com/users/fin-sn-de/events{/privacy}","received_events_url":"https://api.github.com/users/fin-sn-de/received_events","type":"Organization","site_admin":false},"repo":{"id":43085760,"name":"stomp-php","full_name":"fin-sn-de/stomp-php","owner":{"login":"fin-sn-de","id":5948091,"avatar_url":"https://avatars2.githubusercontent.com/u/5948091?v=4","gravatar_id":"","url":"https://api.github.com/users/fin-sn-de","html_url":"https://github.com/fin-sn-de","followers_url":"https://api.github.com/users/fin-sn-de/followers","following_url":"https://api.github.com/users/fin-sn-de/following{/other_user}","gists_url":"https://api.github.com/users/fin-sn-de/gists{/gist_id}","starred_url":"https://api.github.com/users/fin-sn-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fin-sn-de/subscriptions","organizations_url":"https://api.github.com/users/fin-sn-de/orgs","repos_url":"https://api.github.com/users/fin-sn-de/repos","events_url":"https://api.github.com/users/fin-sn-de/events{/privacy}","received_events_url":"https://api.github.com/users/fin-sn-de/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fin-sn-de/stomp-php","description":"Stomp PHP Client","fork":true,"url":"https://api.github.com/repos/fin-sn-de/stomp-php","forks_url":"https://api.github.com/repos/fin-sn-de/stomp-php/forks","keys_url":"https://api.github.com/repos/fin-sn-de/stomp-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fin-sn-de/stomp-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fin-sn-de/stomp-php/teams","hooks_url":"https://api.github.com/repos/fin-sn-de/stomp-php/hooks","issue_events_url":"https://api.github.com/repos/fin-sn-de/stomp-php/issues/events{/number}","events_url":"https://api.github.com/repos/fin-sn-de/stomp-php/events","assignees_url":"https://api.github.com/repos/fin-sn-de/stomp-php/assignees{/user}","branches_url":"https://api.github.com/repos/fin-sn-de/stomp-php/branches{/branch}","tags_url":"https://api.github.com/repos/fin-sn-de/stomp-php/tags","blobs_url":"https://api.github.com/repos/fin-sn-de/stomp-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fin-sn-de/stomp-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fin-sn-de/stomp-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/fin-sn-de/stomp-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fin-sn-de/stomp-php/statuses/{sha}","languages_url":"https://api.github.com/repos/fin-sn-de/stomp-php/languages","stargazers_url":"https://api.github.com/repos/fin-sn-de/stomp-php/stargazers","contributors_url":"https://api.github.com/repos/fin-sn-de/stomp-php/contributors","subscribers_url":"https://api.github.com/repos/fin-sn-de/stomp-php/subscribers","subscription_url":"https://api.github.com/repos/fin-sn-de/stomp-php/subscription","commits_url":"https://api.github.com/repos/fin-sn-de/stomp-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/fin-sn-de/stomp-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/fin-sn-de/stomp-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/fin-sn-de/stomp-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/fin-sn-de/stomp-php/contents/{+path}","compare_url":"https://api.github.com/repos/fin-sn-de/stomp-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fin-sn-de/stomp-php/merges","archive_url":"https://api.github.com/repos/fin-sn-de/stomp-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fin-sn-de/stomp-php/downloads","issues_url":"https://api.github.com/repos/fin-sn-de/stomp-php/issues{/number}","pulls_url":"https://api.github.com/repos/fin-sn-de/stomp-php/pulls{/number}","milestones_url":"https://api.github.com/repos/fin-sn-de/stomp-php/milestones{/number}","notifications_url":"https://api.github.com/repos/fin-sn-de/stomp-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fin-sn-de/stomp-php/labels{/name}","releases_url":"https://api.github.com/repos/fin-sn-de/stomp-php/releases{/id}","deployments_url":"https://api.github.com/repos/fin-sn-de/stomp-php/deployments","created_at":"2015-09-24T18:39:57Z","updated_at":"2016-05-29T15:12:38Z","pushed_at":"2018-03-13T20:40:22Z","git_url":"git://github.com/fin-sn-de/stomp-php.git","ssh_url":"git@github.com:fin-sn-de/stomp-php.git","clone_url":"https://github.com/fin-sn-de/stomp-php.git","svn_url":"https://github.com/fin-sn-de/stomp-php","homepage":"http://stomp.fusesource.org/documentation/php/","size":463,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stomp-php:master","ref":"master","sha":"736ae49ece53b3f1805ba6b238c6ae0d8e5bd004","user":{"login":"stomp-php","id":13528686,"avatar_url":"https://avatars2.githubusercontent.com/u/13528686?v=4","gravatar_id":"","url":"https://api.github.com/users/stomp-php","html_url":"https://github.com/stomp-php","followers_url":"https://api.github.com/users/stomp-php/followers","following_url":"https://api.github.com/users/stomp-php/following{/other_user}","gists_url":"https://api.github.com/users/stomp-php/gists{/gist_id}","starred_url":"https://api.github.com/users/stomp-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stomp-php/subscriptions","organizations_url":"https://api.github.com/users/stomp-php/orgs","repos_url":"https://api.github.com/users/stomp-php/repos","events_url":"https://api.github.com/users/stomp-php/events{/privacy}","received_events_url":"https://api.github.com/users/stomp-php/received_events","type":"Organization","site_admin":false},"repo":{"id":23658479,"name":"stomp-php","full_name":"stomp-php/stomp-php","owner":{"login":"stomp-php","id":13528686,"avatar_url":"https://avatars2.githubusercontent.com/u/13528686?v=4","gravatar_id":"","url":"https://api.github.com/users/stomp-php","html_url":"https://github.com/stomp-php","followers_url":"https://api.github.com/users/stomp-php/followers","following_url":"https://api.github.com/users/stomp-php/following{/other_user}","gists_url":"https://api.github.com/users/stomp-php/gists{/gist_id}","starred_url":"https://api.github.com/users/stomp-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stomp-php/subscriptions","organizations_url":"https://api.github.com/users/stomp-php/orgs","repos_url":"https://api.github.com/users/stomp-php/repos","events_url":"https://api.github.com/users/stomp-php/events{/privacy}","received_events_url":"https://api.github.com/users/stomp-php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stomp-php/stomp-php","description":"Stomp PHP Client","fork":false,"url":"https://api.github.com/repos/stomp-php/stomp-php","forks_url":"https://api.github.com/repos/stomp-php/stomp-php/forks","keys_url":"https://api.github.com/repos/stomp-php/stomp-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stomp-php/stomp-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stomp-php/stomp-php/teams","hooks_url":"https://api.github.com/repos/stomp-php/stomp-php/hooks","issue_events_url":"https://api.github.com/repos/stomp-php/stomp-php/issues/events{/number}","events_url":"https://api.github.com/repos/stomp-php/stomp-php/events","assignees_url":"https://api.github.com/repos/stomp-php/stomp-php/assignees{/user}","branches_url":"https://api.github.com/repos/stomp-php/stomp-php/branches{/branch}","tags_url":"https://api.github.com/repos/stomp-php/stomp-php/tags","blobs_url":"https://api.github.com/repos/stomp-php/stomp-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stomp-php/stomp-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stomp-php/stomp-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/stomp-php/stomp-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stomp-php/stomp-php/statuses/{sha}","languages_url":"https://api.github.com/repos/stomp-php/stomp-php/languages","stargazers_url":"https://api.github.com/repos/stomp-php/stomp-php/stargazers","contributors_url":"https://api.github.com/repos/stomp-php/stomp-php/contributors","subscribers_url":"https://api.github.com/repos/stomp-php/stomp-php/subscribers","subscription_url":"https://api.github.com/repos/stomp-php/stomp-php/subscription","commits_url":"https://api.github.com/repos/stomp-php/stomp-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/stomp-php/stomp-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/stomp-php/stomp-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/stomp-php/stomp-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/stomp-php/stomp-php/contents/{+path}","compare_url":"https://api.github.com/repos/stomp-php/stomp-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stomp-php/stomp-php/merges","archive_url":"https://api.github.com/repos/stomp-php/stomp-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stomp-php/stomp-php/downloads","issues_url":"https://api.github.com/repos/stomp-php/stomp-php/issues{/number}","pulls_url":"https://api.github.com/repos/stomp-php/stomp-php/pulls{/number}","milestones_url":"https://api.github.com/repos/stomp-php/stomp-php/milestones{/number}","notifications_url":"https://api.github.com/repos/stomp-php/stomp-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stomp-php/stomp-php/labels{/name}","releases_url":"https://api.github.com/repos/stomp-php/stomp-php/releases{/id}","deployments_url":"https://api.github.com/repos/stomp-php/stomp-php/deployments","created_at":"2014-09-04T10:41:35Z","updated_at":"2018-02-23T22:34:51Z","pushed_at":"2018-03-13T20:40:24Z","git_url":"git://github.com/stomp-php/stomp-php.git","ssh_url":"git@github.com:stomp-php/stomp-php.git","clone_url":"https://github.com/stomp-php/stomp-php.git","svn_url":"https://github.com/stomp-php/stomp-php","homepage":"https://github.com/stomp-php/stomp-php/wiki","size":448,"stargazers_count":41,"watchers_count":41,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":22,"open_issues":7,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107"},"html":{"href":"https://github.com/stomp-php/stomp-php/pull/107"},"issue":{"href":"https://api.github.com/repos/stomp-php/stomp-php/issues/107"},"comments":{"href":"https://api.github.com/repos/stomp-php/stomp-php/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stomp-php/stomp-php/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/stomp-php/stomp-php/statuses/fbeee3808b1fa4b5c608490604dc80b3e1bd998f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"staabm"}}