{"action":"created","issue":{"url":"https://api.github.com/repos/meqif/rust-utp/issues/4","labels_url":"https://api.github.com/repos/meqif/rust-utp/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/meqif/rust-utp/issues/4/comments","events_url":"https://api.github.com/repos/meqif/rust-utp/issues/4/events","html_url":"https://github.com/meqif/rust-utp/issues/4","id":88255908,"number":4,"title":"Concurrent reads and writes","user":{"login":"meqif","id":1706,"avatar_url":"https://avatars.githubusercontent.com/u/1706?v=3","gravatar_id":"","url":"https://api.github.com/users/meqif","html_url":"https://github.com/meqif","followers_url":"https://api.github.com/users/meqif/followers","following_url":"https://api.github.com/users/meqif/following{/other_user}","gists_url":"https://api.github.com/users/meqif/gists{/gist_id}","starred_url":"https://api.github.com/users/meqif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meqif/subscriptions","organizations_url":"https://api.github.com/users/meqif/orgs","repos_url":"https://api.github.com/users/meqif/repos","events_url":"https://api.github.com/users/meqif/events{/privacy}","received_events_url":"https://api.github.com/users/meqif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-14T22:04:40Z","updated_at":"2015-06-14T22:05:33Z","closed_at":null,"body":"Currently rust-utp doesn't allow concurrent reads and writes to the same socket. This limits its usefulness in a production context.\r\n\r\n# Ways to achieve concurrency\r\n\r\n1. Synchronize socket state access/modification and allow cloning,\r\n2. Split `UtpSocket` into reading and writing halves, and return those instead of a unified socket,\r\n3. Spawn a thread inside `UtpSocket` or `UtpStream` to wait for incoming packets on the underlying UDP socket."},"comment":{"url":"https://api.github.com/repos/meqif/rust-utp/issues/comments/111879180","html_url":"https://github.com/meqif/rust-utp/issues/4#issuecomment-111879180","issue_url":"https://api.github.com/repos/meqif/rust-utp/issues/4","id":111879180,"user":{"login":"meqif","id":1706,"avatar_url":"https://avatars.githubusercontent.com/u/1706?v=3","gravatar_id":"","url":"https://api.github.com/users/meqif","html_url":"https://github.com/meqif","followers_url":"https://api.github.com/users/meqif/followers","following_url":"https://api.github.com/users/meqif/following{/other_user}","gists_url":"https://api.github.com/users/meqif/gists{/gist_id}","starred_url":"https://api.github.com/users/meqif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meqif/subscriptions","organizations_url":"https://api.github.com/users/meqif/orgs","repos_url":"https://api.github.com/users/meqif/repos","events_url":"https://api.github.com/users/meqif/events{/privacy}","received_events_url":"https://api.github.com/users/meqif/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T22:05:33Z","updated_at":"2015-06-14T22:05:33Z","body":"2 seems to me to be the most invasive approach, while 3 feels viscerally wrong.\r\n\r\nI quickly built a prototype of 1 and a simple concurrent client (`examples/concurrent-reads-and-writes`), in the branch `cloneable-socket`. Then I used libutp's ucat as a server to test the client, which seemed to work reasonably well. It seems to me like a viable path."}}