{"action":"created","issue":{"url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/12","labels_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/12/comments","events_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/12/events","html_url":"https://github.com/vtortola/WebSocketListener/pull/12","id":61094595,"number":12,"title":"Update WebSocketMessageWriteStream.cs","user":{"login":"slozier","id":6061329,"avatar_url":"https://avatars.githubusercontent.com/u/6061329?v=3","gravatar_id":"","url":"https://api.github.com/users/slozier","html_url":"https://github.com/slozier","followers_url":"https://api.github.com/users/slozier/followers","following_url":"https://api.github.com/users/slozier/following{/other_user}","gists_url":"https://api.github.com/users/slozier/gists{/gist_id}","starred_url":"https://api.github.com/users/slozier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slozier/subscriptions","organizations_url":"https://api.github.com/users/slozier/orgs","repos_url":"https://api.github.com/users/slozier/repos","events_url":"https://api.github.com/users/slozier/events{/privacy}","received_events_url":"https://api.github.com/users/slozier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-13T15:19:03Z","updated_at":"2015-03-14T19:17:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vtortola/WebSocketListener/pulls/12","html_url":"https://github.com/vtortola/WebSocketListener/pull/12","diff_url":"https://github.com/vtortola/WebSocketListener/pull/12.diff","patch_url":"https://github.com/vtortola/WebSocketListener/pull/12.patch"},"body":"IAsyncResult is a Task and not an AsyncResultTask (see BeginWrite)"},"comment":{"url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/comments/80682268","html_url":"https://github.com/vtortola/WebSocketListener/pull/12#issuecomment-80682268","issue_url":"https://api.github.com/repos/vtortola/WebSocketListener/issues/12","id":80682268,"user":{"login":"vtortola","id":704420,"avatar_url":"https://avatars.githubusercontent.com/u/704420?v=3","gravatar_id":"","url":"https://api.github.com/users/vtortola","html_url":"https://github.com/vtortola","followers_url":"https://api.github.com/users/vtortola/followers","following_url":"https://api.github.com/users/vtortola/following{/other_user}","gists_url":"https://api.github.com/users/vtortola/gists{/gist_id}","starred_url":"https://api.github.com/users/vtortola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtortola/subscriptions","organizations_url":"https://api.github.com/users/vtortola/orgs","repos_url":"https://api.github.com/users/vtortola/repos","events_url":"https://api.github.com/users/vtortola/events{/privacy}","received_events_url":"https://api.github.com/users/vtortola/received_events","type":"User","site_admin":false},"created_at":"2015-03-14T19:17:11Z","updated_at":"2015-03-14T19:17:11Z","body":"You are totally right. I never used the `Begin/End` pattern since I have `async/await` and this bug went unnoticed. \r\n\r\nHowever, the error is in other line, when it does `callback(wrapper.Task)` it should do `callback(wrapper)`, as happens in `WebSocketMessageReadStream`.\r\n\r\nDo you want to close this PR and create another? I can do it myself otherwise."}}