{"action":"created","comment":{"url":"https://api.github.com/repos/tox-rs/tox/pulls/comments/171154340","pull_request_review_id":99956439,"id":171154340,"diff_hunk":"@@ -0,0 +1,236 @@\n+/*\n+    Copyright © 2017 Zetok Zalbavar <zexavexxe@gmail.com>\n+    Copyright © 2018 Namsoo CHO <nscho66@gmail.com>\n+\n+    This file is part of Tox.\n+\n+    Tox is libre software: you can redistribute it and/or modify\n+    it under the terms of the GNU General Public License as published by\n+    the Free Software Foundation, either version 3 of the License, or\n+    (at your option) any later version.\n+\n+    Tox is distributed in the hope that it will be useful,\n+    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+    GNU General Public License for more details.\n+\n+    You should have received a copy of the GNU General Public License\n+    along with Tox.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+\n+/*!\n+Hold peer info. connected.\n+The object of this struct is an object per a peer.\n+*/\n+\n+use futures::{Sink, Future};\n+use futures::sync::mpsc;\n+use tokio_io::IoFuture;\n+\n+//use std::collections::VecDeque;\n+use std::io::{ErrorKind, Error};\n+use std::net::SocketAddr;\n+\n+use toxcore::crypto_core::*;\n+use toxcore::dht_new::packet::*;\n+use toxcore::dht_new::codec::*;\n+\n+/// Shorthand for the transmit half of the message channel.\n+type Tx = mpsc::UnboundedSender<DhtUdpPacket>;\n+\n+/// peer info.\n+#[derive(Clone, Debug)]\n+pub struct Client {\n+    /// Public key of peer\n+    pub pk: PublicKey,\n+    /// socket address of peer\n+    pub addr: SocketAddr,\n+    /// last sent ping_id to check PingResponse is correct\n+    pub ping_id: u64,\n+    // /// last sent NodesRequest id to check NodesResponse is correct\n+    // pub nodes_id: u64,\n+    // /// last sent NatPingRequest id to check NatPingResponse is correct\n+    // pub nat_ping_id: u64,\n+    /// precomputed key for this peer\n+    pub precomputed_key: PrecomputedKey,\n+}\n+\n+impl Client {\n+    /// create Client object\n+    pub fn new(precomputed_key: PrecomputedKey, pk: PublicKey, addr: SocketAddr) -> Client {\n+        Client {\n+            pk: pk,\n+            addr: addr,\n+            precomputed_key: precomputed_key,\n+            ping_id: 0xFFFFFFFFFFFFFFFF,","path":"src/toxcore/dht_new/client.rs","position":66,"original_position":66,"commit_id":"7293bfb67bfd02087f4463a438c2a64fcf01df1a","original_commit_id":"7293bfb67bfd02087f4463a438c2a64fcf01df1a","user":{"login":"kpp","id":467709,"avatar_url":"https://avatars1.githubusercontent.com/u/467709?v=4","gravatar_id":"","url":"https://api.github.com/users/kpp","html_url":"https://github.com/kpp","followers_url":"https://api.github.com/users/kpp/followers","following_url":"https://api.github.com/users/kpp/following{/other_user}","gists_url":"https://api.github.com/users/kpp/gists{/gist_id}","starred_url":"https://api.github.com/users/kpp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpp/subscriptions","organizations_url":"https://api.github.com/users/kpp/orgs","repos_url":"https://api.github.com/users/kpp/repos","events_url":"https://api.github.com/users/kpp/events{/privacy}","received_events_url":"https://api.github.com/users/kpp/received_events","type":"User","site_admin":false},"body":"But why did you chose such a value?","created_at":"2018-02-28T06:40:56Z","updated_at":"2018-02-28T06:40:56Z","html_url":"https://github.com/tox-rs/tox/pull/25#discussion_r171154340","pull_request_url":"https://api.github.com/repos/tox-rs/tox/pulls/25","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/comments/171154340"},"html":{"href":"https://github.com/tox-rs/tox/pull/25#discussion_r171154340"},"pull_request":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/25"}},"in_reply_to_id":171152188},"pull_request":{"url":"https://api.github.com/repos/tox-rs/tox/pulls/25","id":171320369,"html_url":"https://github.com/tox-rs/tox/pull/25","diff_url":"https://github.com/tox-rs/tox/pull/25.diff","patch_url":"https://github.com/tox-rs/tox/pull/25.patch","issue_url":"https://api.github.com/repos/tox-rs/tox/issues/25","number":25,"state":"open","locked":false,"title":"Refactor DHT node","user":{"login":"NamsooCho","id":10192129,"avatar_url":"https://avatars1.githubusercontent.com/u/10192129?v=4","gravatar_id":"","url":"https://api.github.com/users/NamsooCho","html_url":"https://github.com/NamsooCho","followers_url":"https://api.github.com/users/NamsooCho/followers","following_url":"https://api.github.com/users/NamsooCho/following{/other_user}","gists_url":"https://api.github.com/users/NamsooCho/gists{/gist_id}","starred_url":"https://api.github.com/users/NamsooCho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NamsooCho/subscriptions","organizations_url":"https://api.github.com/users/NamsooCho/orgs","repos_url":"https://api.github.com/users/NamsooCho/repos","events_url":"https://api.github.com/users/NamsooCho/events{/privacy}","received_events_url":"https://api.github.com/users/NamsooCho/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-26T09:27:43Z","updated_at":"2018-02-28T06:40:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7764d2f6f99506dfdf35fd629388ebf86afa8d18","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/tox-rs/tox/pulls/25/commits","review_comments_url":"https://api.github.com/repos/tox-rs/tox/pulls/25/comments","review_comment_url":"https://api.github.com/repos/tox-rs/tox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tox-rs/tox/issues/25/comments","statuses_url":"https://api.github.com/repos/tox-rs/tox/statuses/7293bfb67bfd02087f4463a438c2a64fcf01df1a","head":{"label":"NamsooCho:server_with_ping","ref":"server_with_ping","sha":"7293bfb67bfd02087f4463a438c2a64fcf01df1a","user":{"login":"NamsooCho","id":10192129,"avatar_url":"https://avatars1.githubusercontent.com/u/10192129?v=4","gravatar_id":"","url":"https://api.github.com/users/NamsooCho","html_url":"https://github.com/NamsooCho","followers_url":"https://api.github.com/users/NamsooCho/followers","following_url":"https://api.github.com/users/NamsooCho/following{/other_user}","gists_url":"https://api.github.com/users/NamsooCho/gists{/gist_id}","starred_url":"https://api.github.com/users/NamsooCho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NamsooCho/subscriptions","organizations_url":"https://api.github.com/users/NamsooCho/orgs","repos_url":"https://api.github.com/users/NamsooCho/repos","events_url":"https://api.github.com/users/NamsooCho/events{/privacy}","received_events_url":"https://api.github.com/users/NamsooCho/received_events","type":"User","site_admin":false},"repo":{"id":118837644,"name":"tox-1","full_name":"NamsooCho/tox-1","owner":{"login":"NamsooCho","id":10192129,"avatar_url":"https://avatars1.githubusercontent.com/u/10192129?v=4","gravatar_id":"","url":"https://api.github.com/users/NamsooCho","html_url":"https://github.com/NamsooCho","followers_url":"https://api.github.com/users/NamsooCho/followers","following_url":"https://api.github.com/users/NamsooCho/following{/other_user}","gists_url":"https://api.github.com/users/NamsooCho/gists{/gist_id}","starred_url":"https://api.github.com/users/NamsooCho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NamsooCho/subscriptions","organizations_url":"https://api.github.com/users/NamsooCho/orgs","repos_url":"https://api.github.com/users/NamsooCho/repos","events_url":"https://api.github.com/users/NamsooCho/events{/privacy}","received_events_url":"https://api.github.com/users/NamsooCho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NamsooCho/tox-1","description":"toxcore implementation in Rust","fork":true,"url":"https://api.github.com/repos/NamsooCho/tox-1","forks_url":"https://api.github.com/repos/NamsooCho/tox-1/forks","keys_url":"https://api.github.com/repos/NamsooCho/tox-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NamsooCho/tox-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NamsooCho/tox-1/teams","hooks_url":"https://api.github.com/repos/NamsooCho/tox-1/hooks","issue_events_url":"https://api.github.com/repos/NamsooCho/tox-1/issues/events{/number}","events_url":"https://api.github.com/repos/NamsooCho/tox-1/events","assignees_url":"https://api.github.com/repos/NamsooCho/tox-1/assignees{/user}","branches_url":"https://api.github.com/repos/NamsooCho/tox-1/branches{/branch}","tags_url":"https://api.github.com/repos/NamsooCho/tox-1/tags","blobs_url":"https://api.github.com/repos/NamsooCho/tox-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NamsooCho/tox-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NamsooCho/tox-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/NamsooCho/tox-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NamsooCho/tox-1/statuses/{sha}","languages_url":"https://api.github.com/repos/NamsooCho/tox-1/languages","stargazers_url":"https://api.github.com/repos/NamsooCho/tox-1/stargazers","contributors_url":"https://api.github.com/repos/NamsooCho/tox-1/contributors","subscribers_url":"https://api.github.com/repos/NamsooCho/tox-1/subscribers","subscription_url":"https://api.github.com/repos/NamsooCho/tox-1/subscription","commits_url":"https://api.github.com/repos/NamsooCho/tox-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/NamsooCho/tox-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/NamsooCho/tox-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/NamsooCho/tox-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/NamsooCho/tox-1/contents/{+path}","compare_url":"https://api.github.com/repos/NamsooCho/tox-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NamsooCho/tox-1/merges","archive_url":"https://api.github.com/repos/NamsooCho/tox-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NamsooCho/tox-1/downloads","issues_url":"https://api.github.com/repos/NamsooCho/tox-1/issues{/number}","pulls_url":"https://api.github.com/repos/NamsooCho/tox-1/pulls{/number}","milestones_url":"https://api.github.com/repos/NamsooCho/tox-1/milestones{/number}","notifications_url":"https://api.github.com/repos/NamsooCho/tox-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NamsooCho/tox-1/labels{/name}","releases_url":"https://api.github.com/repos/NamsooCho/tox-1/releases{/id}","deployments_url":"https://api.github.com/repos/NamsooCho/tox-1/deployments","created_at":"2018-01-24T23:59:01Z","updated_at":"2018-01-24T23:59:03Z","pushed_at":"2018-02-28T05:18:12Z","git_url":"git://github.com/NamsooCho/tox-1.git","ssh_url":"git@github.com:NamsooCho/tox-1.git","clone_url":"https://github.com/NamsooCho/tox-1.git","svn_url":"https://github.com/NamsooCho/tox-1","homepage":"","size":1516,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tox-rs:master","ref":"master","sha":"35400004fe7a826440b623baff30ce1cfc1fa6f5","user":{"login":"tox-rs","id":35774911,"avatar_url":"https://avatars2.githubusercontent.com/u/35774911?v=4","gravatar_id":"","url":"https://api.github.com/users/tox-rs","html_url":"https://github.com/tox-rs","followers_url":"https://api.github.com/users/tox-rs/followers","following_url":"https://api.github.com/users/tox-rs/following{/other_user}","gists_url":"https://api.github.com/users/tox-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/tox-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tox-rs/subscriptions","organizations_url":"https://api.github.com/users/tox-rs/orgs","repos_url":"https://api.github.com/users/tox-rs/repos","events_url":"https://api.github.com/users/tox-rs/events{/privacy}","received_events_url":"https://api.github.com/users/tox-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":118792123,"name":"tox","full_name":"tox-rs/tox","owner":{"login":"tox-rs","id":35774911,"avatar_url":"https://avatars2.githubusercontent.com/u/35774911?v=4","gravatar_id":"","url":"https://api.github.com/users/tox-rs","html_url":"https://github.com/tox-rs","followers_url":"https://api.github.com/users/tox-rs/followers","following_url":"https://api.github.com/users/tox-rs/following{/other_user}","gists_url":"https://api.github.com/users/tox-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/tox-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tox-rs/subscriptions","organizations_url":"https://api.github.com/users/tox-rs/orgs","repos_url":"https://api.github.com/users/tox-rs/repos","events_url":"https://api.github.com/users/tox-rs/events{/privacy}","received_events_url":"https://api.github.com/users/tox-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tox-rs/tox","description":"toxcore implementation in Rust","fork":false,"url":"https://api.github.com/repos/tox-rs/tox","forks_url":"https://api.github.com/repos/tox-rs/tox/forks","keys_url":"https://api.github.com/repos/tox-rs/tox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tox-rs/tox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tox-rs/tox/teams","hooks_url":"https://api.github.com/repos/tox-rs/tox/hooks","issue_events_url":"https://api.github.com/repos/tox-rs/tox/issues/events{/number}","events_url":"https://api.github.com/repos/tox-rs/tox/events","assignees_url":"https://api.github.com/repos/tox-rs/tox/assignees{/user}","branches_url":"https://api.github.com/repos/tox-rs/tox/branches{/branch}","tags_url":"https://api.github.com/repos/tox-rs/tox/tags","blobs_url":"https://api.github.com/repos/tox-rs/tox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tox-rs/tox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tox-rs/tox/git/refs{/sha}","trees_url":"https://api.github.com/repos/tox-rs/tox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tox-rs/tox/statuses/{sha}","languages_url":"https://api.github.com/repos/tox-rs/tox/languages","stargazers_url":"https://api.github.com/repos/tox-rs/tox/stargazers","contributors_url":"https://api.github.com/repos/tox-rs/tox/contributors","subscribers_url":"https://api.github.com/repos/tox-rs/tox/subscribers","subscription_url":"https://api.github.com/repos/tox-rs/tox/subscription","commits_url":"https://api.github.com/repos/tox-rs/tox/commits{/sha}","git_commits_url":"https://api.github.com/repos/tox-rs/tox/git/commits{/sha}","comments_url":"https://api.github.com/repos/tox-rs/tox/comments{/number}","issue_comment_url":"https://api.github.com/repos/tox-rs/tox/issues/comments{/number}","contents_url":"https://api.github.com/repos/tox-rs/tox/contents/{+path}","compare_url":"https://api.github.com/repos/tox-rs/tox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tox-rs/tox/merges","archive_url":"https://api.github.com/repos/tox-rs/tox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tox-rs/tox/downloads","issues_url":"https://api.github.com/repos/tox-rs/tox/issues{/number}","pulls_url":"https://api.github.com/repos/tox-rs/tox/pulls{/number}","milestones_url":"https://api.github.com/repos/tox-rs/tox/milestones{/number}","notifications_url":"https://api.github.com/repos/tox-rs/tox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tox-rs/tox/labels{/name}","releases_url":"https://api.github.com/repos/tox-rs/tox/releases{/id}","deployments_url":"https://api.github.com/repos/tox-rs/tox/deployments","created_at":"2018-01-24T16:35:53Z","updated_at":"2018-02-26T21:47:10Z","pushed_at":"2018-02-28T06:34:10Z","git_url":"git://github.com/tox-rs/tox.git","ssh_url":"git@github.com:tox-rs/tox.git","clone_url":"https://github.com/tox-rs/tox.git","svn_url":"https://github.com/tox-rs/tox","homepage":"","size":1421,"stargazers_count":11,"watchers_count":11,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/25"},"html":{"href":"https://github.com/tox-rs/tox/pull/25"},"issue":{"href":"https://api.github.com/repos/tox-rs/tox/issues/25"},"comments":{"href":"https://api.github.com/repos/tox-rs/tox/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tox-rs/tox/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/tox-rs/tox/statuses/7293bfb67bfd02087f4463a438c2a64fcf01df1a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"kpp"}}