{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefxlab/issues/1233","repository_url":"https://api.github.com/repos/dotnet/corefxlab","labels_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1233/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1233/comments","events_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1233/events","html_url":"https://github.com/dotnet/corefxlab/issues/1233","id":209114960,"number":1233,"title":"WritableBuffer: add support for non-contiguous Write","user":{"login":"tmds","id":1025424,"avatar_url":"https://avatars2.githubusercontent.com/u/1025424?v=3","gravatar_id":"","url":"https://api.github.com/users/tmds","html_url":"https://github.com/tmds","followers_url":"https://api.github.com/users/tmds/followers","following_url":"https://api.github.com/users/tmds/following{/other_user}","gists_url":"https://api.github.com/users/tmds/gists{/gist_id}","starred_url":"https://api.github.com/users/tmds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmds/subscriptions","organizations_url":"https://api.github.com/users/tmds/orgs","repos_url":"https://api.github.com/users/tmds/repos","events_url":"https://api.github.com/users/tmds/events{/privacy}","received_events_url":"https://api.github.com/users/tmds/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":34,"created_at":"2017-02-21T11:21:19Z","updated_at":"2017-03-25T13:46:18Z","closed_at":null,"body":"The WSARecvFrom/recvmsg calls support receiving to a non-contiguous memory region.\r\n\r\nI don't think the WritableBuffer supports allocating for such operations.\r\n\r\nI.e. doing something like:\r\n```C#\r\nint allocated = 0;\r\nwhile (allocated < needed)\r\n{\r\n   allocated += writableBuffer.Length;\r\n   buffers.Add(writableBuffer.Memory);\r\n   if (allocated < needed)\r\n   {\r\n       // adds a new segment available for writing at end of write head list\r\n       // doesn't update the writeHead\r\n       // Writable.Memory points to new segment\r\n       writableBuffer.AllocSegment();\r\n   }\r\n}\r\n\r\nint received = recvmsg(buffers);\r\n\r\n// crosses segments\r\n// updates writeHead\r\n// writeHead.Next = null, Allocated segments after writeHead are Disposed\r\n// Writable.Memory points to writeHead\r\nwritableBuffer.AdvanceWriter(received);\r\n```\r\n\r\nEnsure and Append should throw InvalidOperationException when writeHead.Next != null."},"comment":{"url":"https://api.github.com/repos/dotnet/corefxlab/issues/comments/289212644","html_url":"https://github.com/dotnet/corefxlab/issues/1233#issuecomment-289212644","issue_url":"https://api.github.com/repos/dotnet/corefxlab/issues/1233","id":289212644,"user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars2.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"created_at":"2017-03-25T13:46:18Z","updated_at":"2017-03-25T13:46:18Z","body":"Oh I think I kinda get what you are talking about... You mean when the socket \"completes\" with no more receive data; you want to get the uncommitted chain of buffers `.Next -> .Next -> .Next` and put it somewhere else? (because you are over allocating up front)"}}
{"actor":{"display_login":"benaadams"}}