{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/wcf/pulls/comments/42288868","id":42288868,"diff_hunk":"@@ -0,0 +1,234 @@\n+﻿// Copyright (c) Microsoft. All rights reserved.\n+// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n+\n+using System;\n+using System.IO;\n+using System.ServiceModel;\n+using System.ServiceModel.Channels;\n+using Xunit;\n+\n+public static class WebSocketTests\n+{\n+    [Fact]\n+    [OuterLoop]\n+    [ActiveIssue(424)]\n+    public static void WebSocketHttpRequestReplyBinaryStreamed()\n+    {\n+        NetHttpBinding binding = null;\n+        ChannelFactory<IWSRequestReplyService> channelFactory = null;\n+        IWSRequestReplyService client = null;\n+        FlowControlledStream uploadStream = null;\n+\n+        try\n+        {\n+            // *** SETUP *** \\\\\n+            binding = new NetHttpBinding();\n+            binding.WebSocketSettings.TransportUsage = WebSocketTransportUsage.Always;\n+            binding.MaxReceivedMessageSize = ScenarioTestHelpers.DefaultMaxReceivedMessageSize;\n+            binding.MaxBufferSize = ScenarioTestHelpers.DefaultMaxReceivedMessageSize;\n+            binding.TransferMode = TransferMode.Streamed;\n+            binding.MessageEncoding = NetHttpMessageEncoding.Binary;\n+\n+            channelFactory = new ChannelFactory<IWSRequestReplyService>(binding, new EndpointAddress(Endpoints.WebSocketHttpRequestReplyBinaryStreamed_Address));\n+            client = channelFactory.CreateChannel();\n+\n+            // *** EXECUTE *** \\\\\n+            using (Stream stream = client.DownloadStream())\n+            {\n+                int readResult;\n+                // Read from the stream, 1000 bytes at a time.\n+                byte[] buffer = new byte[1000];\n+\n+                do\n+                {\n+                    readResult = stream.Read(buffer, 0, buffer.Length);\n+                }\n+                while (readResult != 0);\n+            }\n+\n+            uploadStream = new FlowControlledStream();\n+            uploadStream.ReadThrottle = TimeSpan.FromMilliseconds(500);","path":"src/System.Private.ServiceModel/tests/Scenarios/Extensibility/WebSockets/WebSocketTests.cs","position":50,"original_position":50,"commit_id":"751e56338c3d01043c1e0a7072c58f88758724e7","original_commit_id":"751e56338c3d01043c1e0a7072c58f88758724e7","user":{"login":"roncain","id":3913124,"avatar_url":"https://avatars.githubusercontent.com/u/3913124?v=3","gravatar_id":"","url":"https://api.github.com/users/roncain","html_url":"https://github.com/roncain","followers_url":"https://api.github.com/users/roncain/followers","following_url":"https://api.github.com/users/roncain/following{/other_user}","gists_url":"https://api.github.com/users/roncain/gists{/gist_id}","starred_url":"https://api.github.com/users/roncain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roncain/subscriptions","organizations_url":"https://api.github.com/users/roncain/orgs","repos_url":"https://api.github.com/users/roncain/repos","events_url":"https://api.github.com/users/roncain/events{/privacy}","received_events_url":"https://api.github.com/users/roncain/received_events","type":"User","site_admin":false},"body":"FlowControlledStream is a Stream which is IDisposable.  So it should be put in a 'using' or disposed in the finally block","created_at":"2015-10-16T20:51:58Z","updated_at":"2015-10-16T20:51:58Z","html_url":"https://github.com/dotnet/wcf/pull/426#discussion_r42288868","pull_request_url":"https://api.github.com/repos/dotnet/wcf/pulls/426","_links":{"self":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/comments/42288868"},"html":{"href":"https://github.com/dotnet/wcf/pull/426#discussion_r42288868"},"pull_request":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/426"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/wcf/pulls/426","id":47697692,"html_url":"https://github.com/dotnet/wcf/pull/426","diff_url":"https://github.com/dotnet/wcf/pull/426.diff","patch_url":"https://github.com/dotnet/wcf/pull/426.patch","issue_url":"https://api.github.com/repos/dotnet/wcf/issues/426","number":426,"state":"open","locked":false,"title":"Adding three WebSocket streaming scenario tests.","user":{"login":"StephenBonikowsky","id":12057732,"avatar_url":"https://avatars.githubusercontent.com/u/12057732?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBonikowsky","html_url":"https://github.com/StephenBonikowsky","followers_url":"https://api.github.com/users/StephenBonikowsky/followers","following_url":"https://api.github.com/users/StephenBonikowsky/following{/other_user}","gists_url":"https://api.github.com/users/StephenBonikowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBonikowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBonikowsky/subscriptions","organizations_url":"https://api.github.com/users/StephenBonikowsky/orgs","repos_url":"https://api.github.com/users/StephenBonikowsky/repos","events_url":"https://api.github.com/users/StephenBonikowsky/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBonikowsky/received_events","type":"User","site_admin":false},"body":"* Fixed one issue where a timeout in the WebSocketTransportDuplexSessionChannel class was not being set.\r\n* Ran into another problem, opened issue 424\r\n* These tests run and pass on desktop using the Bridge.\r\n* These tests are a partial fix of issue 384\r\n* Placing these tests in a new folder called \"Extensibility\" based on the logic used for locating previously released WCF Samples.\r\n* Opened issue 425 to move other WebSocket tests to this location\r\n* The new Contracts include operations not used by current set of tests, leaving as is because forthcoming tests will use these operations.\r\n* Removed and sorted using statements wherever I saw that it needed it.","created_at":"2015-10-14T18:38:05Z","updated_at":"2015-10-16T20:51:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ddb4b3920bac92219df9a248515b51d80dc732d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/wcf/pulls/426/commits","review_comments_url":"https://api.github.com/repos/dotnet/wcf/pulls/426/comments","review_comment_url":"https://api.github.com/repos/dotnet/wcf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/wcf/issues/426/comments","statuses_url":"https://api.github.com/repos/dotnet/wcf/statuses/751e56338c3d01043c1e0a7072c58f88758724e7","head":{"label":"StephenBonikowsky:WebSocketStreamingTests","ref":"WebSocketStreamingTests","sha":"751e56338c3d01043c1e0a7072c58f88758724e7","user":{"login":"StephenBonikowsky","id":12057732,"avatar_url":"https://avatars.githubusercontent.com/u/12057732?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBonikowsky","html_url":"https://github.com/StephenBonikowsky","followers_url":"https://api.github.com/users/StephenBonikowsky/followers","following_url":"https://api.github.com/users/StephenBonikowsky/following{/other_user}","gists_url":"https://api.github.com/users/StephenBonikowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBonikowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBonikowsky/subscriptions","organizations_url":"https://api.github.com/users/StephenBonikowsky/orgs","repos_url":"https://api.github.com/users/StephenBonikowsky/repos","events_url":"https://api.github.com/users/StephenBonikowsky/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBonikowsky/received_events","type":"User","site_admin":false},"repo":{"id":35977176,"name":"wcf","full_name":"StephenBonikowsky/wcf","owner":{"login":"StephenBonikowsky","id":12057732,"avatar_url":"https://avatars.githubusercontent.com/u/12057732?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenBonikowsky","html_url":"https://github.com/StephenBonikowsky","followers_url":"https://api.github.com/users/StephenBonikowsky/followers","following_url":"https://api.github.com/users/StephenBonikowsky/following{/other_user}","gists_url":"https://api.github.com/users/StephenBonikowsky/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenBonikowsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenBonikowsky/subscriptions","organizations_url":"https://api.github.com/users/StephenBonikowsky/orgs","repos_url":"https://api.github.com/users/StephenBonikowsky/repos","events_url":"https://api.github.com/users/StephenBonikowsky/events{/privacy}","received_events_url":"https://api.github.com/users/StephenBonikowsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/StephenBonikowsky/wcf","description":"This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.","fork":true,"url":"https://api.github.com/repos/StephenBonikowsky/wcf","forks_url":"https://api.github.com/repos/StephenBonikowsky/wcf/forks","keys_url":"https://api.github.com/repos/StephenBonikowsky/wcf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/StephenBonikowsky/wcf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/StephenBonikowsky/wcf/teams","hooks_url":"https://api.github.com/repos/StephenBonikowsky/wcf/hooks","issue_events_url":"https://api.github.com/repos/StephenBonikowsky/wcf/issues/events{/number}","events_url":"https://api.github.com/repos/StephenBonikowsky/wcf/events","assignees_url":"https://api.github.com/repos/StephenBonikowsky/wcf/assignees{/user}","branches_url":"https://api.github.com/repos/StephenBonikowsky/wcf/branches{/branch}","tags_url":"https://api.github.com/repos/StephenBonikowsky/wcf/tags","blobs_url":"https://api.github.com/repos/StephenBonikowsky/wcf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/StephenBonikowsky/wcf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/StephenBonikowsky/wcf/git/refs{/sha}","trees_url":"https://api.github.com/repos/StephenBonikowsky/wcf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/StephenBonikowsky/wcf/statuses/{sha}","languages_url":"https://api.github.com/repos/StephenBonikowsky/wcf/languages","stargazers_url":"https://api.github.com/repos/StephenBonikowsky/wcf/stargazers","contributors_url":"https://api.github.com/repos/StephenBonikowsky/wcf/contributors","subscribers_url":"https://api.github.com/repos/StephenBonikowsky/wcf/subscribers","subscription_url":"https://api.github.com/repos/StephenBonikowsky/wcf/subscription","commits_url":"https://api.github.com/repos/StephenBonikowsky/wcf/commits{/sha}","git_commits_url":"https://api.github.com/repos/StephenBonikowsky/wcf/git/commits{/sha}","comments_url":"https://api.github.com/repos/StephenBonikowsky/wcf/comments{/number}","issue_comment_url":"https://api.github.com/repos/StephenBonikowsky/wcf/issues/comments{/number}","contents_url":"https://api.github.com/repos/StephenBonikowsky/wcf/contents/{+path}","compare_url":"https://api.github.com/repos/StephenBonikowsky/wcf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/StephenBonikowsky/wcf/merges","archive_url":"https://api.github.com/repos/StephenBonikowsky/wcf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/StephenBonikowsky/wcf/downloads","issues_url":"https://api.github.com/repos/StephenBonikowsky/wcf/issues{/number}","pulls_url":"https://api.github.com/repos/StephenBonikowsky/wcf/pulls{/number}","milestones_url":"https://api.github.com/repos/StephenBonikowsky/wcf/milestones{/number}","notifications_url":"https://api.github.com/repos/StephenBonikowsky/wcf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/StephenBonikowsky/wcf/labels{/name}","releases_url":"https://api.github.com/repos/StephenBonikowsky/wcf/releases{/id}","created_at":"2015-05-20T22:17:45Z","updated_at":"2015-05-20T22:17:46Z","pushed_at":"2015-10-16T16:50:45Z","git_url":"git://github.com/StephenBonikowsky/wcf.git","ssh_url":"git@github.com:StephenBonikowsky/wcf.git","clone_url":"https://github.com/StephenBonikowsky/wcf.git","svn_url":"https://github.com/StephenBonikowsky/wcf","homepage":"","size":2850,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"c8b49962c70f617a9526fcee6cbcbb5e2a9114da","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":35562993,"name":"wcf","full_name":"dotnet/wcf","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/wcf","description":"This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.","fork":false,"url":"https://api.github.com/repos/dotnet/wcf","forks_url":"https://api.github.com/repos/dotnet/wcf/forks","keys_url":"https://api.github.com/repos/dotnet/wcf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/wcf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/wcf/teams","hooks_url":"https://api.github.com/repos/dotnet/wcf/hooks","issue_events_url":"https://api.github.com/repos/dotnet/wcf/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/wcf/events","assignees_url":"https://api.github.com/repos/dotnet/wcf/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/wcf/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/wcf/tags","blobs_url":"https://api.github.com/repos/dotnet/wcf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/wcf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/wcf/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/wcf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/wcf/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/wcf/languages","stargazers_url":"https://api.github.com/repos/dotnet/wcf/stargazers","contributors_url":"https://api.github.com/repos/dotnet/wcf/contributors","subscribers_url":"https://api.github.com/repos/dotnet/wcf/subscribers","subscription_url":"https://api.github.com/repos/dotnet/wcf/subscription","commits_url":"https://api.github.com/repos/dotnet/wcf/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/wcf/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/wcf/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/wcf/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/wcf/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/wcf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/wcf/merges","archive_url":"https://api.github.com/repos/dotnet/wcf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/wcf/downloads","issues_url":"https://api.github.com/repos/dotnet/wcf/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/wcf/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/wcf/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/wcf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/wcf/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/wcf/releases{/id}","created_at":"2015-05-13T17:17:03Z","updated_at":"2015-10-15T19:39:01Z","pushed_at":"2015-10-16T17:43:08Z","git_url":"git://github.com/dotnet/wcf.git","ssh_url":"git@github.com:dotnet/wcf.git","clone_url":"https://github.com/dotnet/wcf.git","svn_url":"https://github.com/dotnet/wcf","homepage":"","size":5853,"stargazers_count":521,"watchers_count":521,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":155,"mirror_url":null,"open_issues_count":114,"forks":155,"open_issues":114,"watchers":521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/426"},"html":{"href":"https://github.com/dotnet/wcf/pull/426"},"issue":{"href":"https://api.github.com/repos/dotnet/wcf/issues/426"},"comments":{"href":"https://api.github.com/repos/dotnet/wcf/issues/426/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/426/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/wcf/pulls/426/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/wcf/statuses/751e56338c3d01043c1e0a7072c58f88758724e7"}}}}