{"action":"created","comment":{"url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/comments/63185728","id":63185728,"diff_hunk":"@@ -202,33 +215,67 @@ public function resolve($hostname, $cb, $noncache = false)\n             } else {\n                 $pool->resolveCache->put($hostname, $addrs, $ttl);\n             }\n-        });\n+        }, $noncache, $nameServers);\n     }\n \n     /**\n      * Gets the host information\n      * @param  string   $hostname Hostname\n      * @param  callable $cb       Callback\n      * @param  boolean  $noncache Noncache?\n+     * @param  array    $nameServers\n+     * @param  string   $proto\n      * @callback $cb ( )\n      * @return void\n      */\n-    public function get($hostname, $cb, $noncache = false)\n+    public function get($hostname, $cb, $noncache = false, $nameServers = [], $proto = 'udp') \n     {\n+        $pool = $this;\n+        if(!$nameServers){\n+            $nameServers = $this->nameServers;\n+        }\n         if (!$this->preloading->hasCompleted()) {\n-            $pool = $this;\n-            $this->preloading->addListener(function ($job) use ($hostname, $cb, $noncache, $pool) {\n-                $pool->get($hostname, $cb, $noncache);\n+            $this->preloading->addListener(function ($job) use ($hostname, $cb, $noncache, $pool, $nameServers, $proto) {\n+                $pool->get($hostname, $cb, $noncache, $nameServers, $proto);\n             });\n             return;\n         }\n-        $this->getConnectionByKey($hostname, function ($conn) use ($cb, $hostname) {\n+        $nameServer = reset ($nameServers);\n+        $isIpv6 = filter_var($nameServer, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n+        if($isIpv6){\n+            $nameServer = '[' . $nameServer . ']';\n+        }\n+        $onGetConnection = function ($conn) use ($cb, $hostname, $nameServers, $noncache, $pool, $proto) {\n             if (!$conn || !$conn->isConnected()) {\n-                $cb(false);\n+                if($proto == 'udp'){","path":"PHPDaemon/Clients/DNS/Pool.php","position":122,"original_position":122,"commit_id":"af1532160ec9a1b0299d35c9481b3d9ed09e2f97","original_commit_id":"af1532160ec9a1b0299d35c9481b3d9ed09e2f97","user":{"login":"kakserpom","id":175350,"avatar_url":"https://avatars.githubusercontent.com/u/175350?v=3","gravatar_id":"","url":"https://api.github.com/users/kakserpom","html_url":"https://github.com/kakserpom","followers_url":"https://api.github.com/users/kakserpom/followers","following_url":"https://api.github.com/users/kakserpom/following{/other_user}","gists_url":"https://api.github.com/users/kakserpom/gists{/gist_id}","starred_url":"https://api.github.com/users/kakserpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakserpom/subscriptions","organizations_url":"https://api.github.com/users/kakserpom/orgs","repos_url":"https://api.github.com/users/kakserpom/repos","events_url":"https://api.github.com/users/kakserpom/events{/privacy}","received_events_url":"https://api.github.com/users/kakserpom/received_events","type":"User","site_admin":false},"body":"'==='","created_at":"2016-05-13T13:51:56Z","updated_at":"2016-05-13T13:51:56Z","html_url":"https://github.com/kakserpom/phpdaemon/pull/235#discussion_r63185728","pull_request_url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/comments/63185728"},"html":{"href":"https://github.com/kakserpom/phpdaemon/pull/235#discussion_r63185728"},"pull_request":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235","id":69836888,"html_url":"https://github.com/kakserpom/phpdaemon/pull/235","diff_url":"https://github.com/kakserpom/phpdaemon/pull/235.diff","patch_url":"https://github.com/kakserpom/phpdaemon/pull/235.patch","issue_url":"https://api.github.com/repos/kakserpom/phpdaemon/issues/235","number":235,"state":"open","locked":false,"title":"improved DNS client: read NS,TXT,SRV,SOA,AAAA records; make AXFR quer…","user":{"login":"heretic-m","id":18677882,"avatar_url":"https://avatars.githubusercontent.com/u/18677882?v=3","gravatar_id":"","url":"https://api.github.com/users/heretic-m","html_url":"https://github.com/heretic-m","followers_url":"https://api.github.com/users/heretic-m/followers","following_url":"https://api.github.com/users/heretic-m/following{/other_user}","gists_url":"https://api.github.com/users/heretic-m/gists{/gist_id}","starred_url":"https://api.github.com/users/heretic-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heretic-m/subscriptions","organizations_url":"https://api.github.com/users/heretic-m/orgs","repos_url":"https://api.github.com/users/heretic-m/repos","events_url":"https://api.github.com/users/heretic-m/events{/privacy}","received_events_url":"https://api.github.com/users/heretic-m/received_events","type":"User","site_admin":false},"body":"…y; working with TCP; fix hosts file","created_at":"2016-05-12T13:33:39Z","updated_at":"2016-05-13T13:51:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"159154368211298101cfca4c260e897e83a005fa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235/commits","review_comments_url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235/comments","review_comment_url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kakserpom/phpdaemon/issues/235/comments","statuses_url":"https://api.github.com/repos/kakserpom/phpdaemon/statuses/af1532160ec9a1b0299d35c9481b3d9ed09e2f97","head":{"label":"heretic-m:master","ref":"master","sha":"af1532160ec9a1b0299d35c9481b3d9ed09e2f97","user":{"login":"heretic-m","id":18677882,"avatar_url":"https://avatars.githubusercontent.com/u/18677882?v=3","gravatar_id":"","url":"https://api.github.com/users/heretic-m","html_url":"https://github.com/heretic-m","followers_url":"https://api.github.com/users/heretic-m/followers","following_url":"https://api.github.com/users/heretic-m/following{/other_user}","gists_url":"https://api.github.com/users/heretic-m/gists{/gist_id}","starred_url":"https://api.github.com/users/heretic-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heretic-m/subscriptions","organizations_url":"https://api.github.com/users/heretic-m/orgs","repos_url":"https://api.github.com/users/heretic-m/repos","events_url":"https://api.github.com/users/heretic-m/events{/privacy}","received_events_url":"https://api.github.com/users/heretic-m/received_events","type":"User","site_admin":false},"repo":{"id":58642371,"name":"phpdaemon","full_name":"heretic-m/phpdaemon","owner":{"login":"heretic-m","id":18677882,"avatar_url":"https://avatars.githubusercontent.com/u/18677882?v=3","gravatar_id":"","url":"https://api.github.com/users/heretic-m","html_url":"https://github.com/heretic-m","followers_url":"https://api.github.com/users/heretic-m/followers","following_url":"https://api.github.com/users/heretic-m/following{/other_user}","gists_url":"https://api.github.com/users/heretic-m/gists{/gist_id}","starred_url":"https://api.github.com/users/heretic-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heretic-m/subscriptions","organizations_url":"https://api.github.com/users/heretic-m/orgs","repos_url":"https://api.github.com/users/heretic-m/repos","events_url":"https://api.github.com/users/heretic-m/events{/privacy}","received_events_url":"https://api.github.com/users/heretic-m/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heretic-m/phpdaemon","description":"Asynchronous server-side framework for network applications implemented in PHP using libevent","fork":true,"url":"https://api.github.com/repos/heretic-m/phpdaemon","forks_url":"https://api.github.com/repos/heretic-m/phpdaemon/forks","keys_url":"https://api.github.com/repos/heretic-m/phpdaemon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heretic-m/phpdaemon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heretic-m/phpdaemon/teams","hooks_url":"https://api.github.com/repos/heretic-m/phpdaemon/hooks","issue_events_url":"https://api.github.com/repos/heretic-m/phpdaemon/issues/events{/number}","events_url":"https://api.github.com/repos/heretic-m/phpdaemon/events","assignees_url":"https://api.github.com/repos/heretic-m/phpdaemon/assignees{/user}","branches_url":"https://api.github.com/repos/heretic-m/phpdaemon/branches{/branch}","tags_url":"https://api.github.com/repos/heretic-m/phpdaemon/tags","blobs_url":"https://api.github.com/repos/heretic-m/phpdaemon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heretic-m/phpdaemon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heretic-m/phpdaemon/git/refs{/sha}","trees_url":"https://api.github.com/repos/heretic-m/phpdaemon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heretic-m/phpdaemon/statuses/{sha}","languages_url":"https://api.github.com/repos/heretic-m/phpdaemon/languages","stargazers_url":"https://api.github.com/repos/heretic-m/phpdaemon/stargazers","contributors_url":"https://api.github.com/repos/heretic-m/phpdaemon/contributors","subscribers_url":"https://api.github.com/repos/heretic-m/phpdaemon/subscribers","subscription_url":"https://api.github.com/repos/heretic-m/phpdaemon/subscription","commits_url":"https://api.github.com/repos/heretic-m/phpdaemon/commits{/sha}","git_commits_url":"https://api.github.com/repos/heretic-m/phpdaemon/git/commits{/sha}","comments_url":"https://api.github.com/repos/heretic-m/phpdaemon/comments{/number}","issue_comment_url":"https://api.github.com/repos/heretic-m/phpdaemon/issues/comments{/number}","contents_url":"https://api.github.com/repos/heretic-m/phpdaemon/contents/{+path}","compare_url":"https://api.github.com/repos/heretic-m/phpdaemon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heretic-m/phpdaemon/merges","archive_url":"https://api.github.com/repos/heretic-m/phpdaemon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heretic-m/phpdaemon/downloads","issues_url":"https://api.github.com/repos/heretic-m/phpdaemon/issues{/number}","pulls_url":"https://api.github.com/repos/heretic-m/phpdaemon/pulls{/number}","milestones_url":"https://api.github.com/repos/heretic-m/phpdaemon/milestones{/number}","notifications_url":"https://api.github.com/repos/heretic-m/phpdaemon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heretic-m/phpdaemon/labels{/name}","releases_url":"https://api.github.com/repos/heretic-m/phpdaemon/releases{/id}","deployments_url":"https://api.github.com/repos/heretic-m/phpdaemon/deployments","created_at":"2016-05-12T13:07:36Z","updated_at":"2016-05-12T13:07:37Z","pushed_at":"2016-05-13T13:33:15Z","git_url":"git://github.com/heretic-m/phpdaemon.git","ssh_url":"git@github.com:heretic-m/phpdaemon.git","clone_url":"https://github.com/heretic-m/phpdaemon.git","svn_url":"https://github.com/heretic-m/phpdaemon","homepage":"http://daemon.io/","size":7961,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"kakserpom:master","ref":"master","sha":"4ba9dc1518be4ab96606050883185c07f3923f1b","user":{"login":"kakserpom","id":175350,"avatar_url":"https://avatars.githubusercontent.com/u/175350?v=3","gravatar_id":"","url":"https://api.github.com/users/kakserpom","html_url":"https://github.com/kakserpom","followers_url":"https://api.github.com/users/kakserpom/followers","following_url":"https://api.github.com/users/kakserpom/following{/other_user}","gists_url":"https://api.github.com/users/kakserpom/gists{/gist_id}","starred_url":"https://api.github.com/users/kakserpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakserpom/subscriptions","organizations_url":"https://api.github.com/users/kakserpom/orgs","repos_url":"https://api.github.com/users/kakserpom/repos","events_url":"https://api.github.com/users/kakserpom/events{/privacy}","received_events_url":"https://api.github.com/users/kakserpom/received_events","type":"User","site_admin":false},"repo":{"id":566426,"name":"phpdaemon","full_name":"kakserpom/phpdaemon","owner":{"login":"kakserpom","id":175350,"avatar_url":"https://avatars.githubusercontent.com/u/175350?v=3","gravatar_id":"","url":"https://api.github.com/users/kakserpom","html_url":"https://github.com/kakserpom","followers_url":"https://api.github.com/users/kakserpom/followers","following_url":"https://api.github.com/users/kakserpom/following{/other_user}","gists_url":"https://api.github.com/users/kakserpom/gists{/gist_id}","starred_url":"https://api.github.com/users/kakserpom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakserpom/subscriptions","organizations_url":"https://api.github.com/users/kakserpom/orgs","repos_url":"https://api.github.com/users/kakserpom/repos","events_url":"https://api.github.com/users/kakserpom/events{/privacy}","received_events_url":"https://api.github.com/users/kakserpom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kakserpom/phpdaemon","description":"Asynchronous server-side framework for network applications implemented in PHP using libevent","fork":false,"url":"https://api.github.com/repos/kakserpom/phpdaemon","forks_url":"https://api.github.com/repos/kakserpom/phpdaemon/forks","keys_url":"https://api.github.com/repos/kakserpom/phpdaemon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kakserpom/phpdaemon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kakserpom/phpdaemon/teams","hooks_url":"https://api.github.com/repos/kakserpom/phpdaemon/hooks","issue_events_url":"https://api.github.com/repos/kakserpom/phpdaemon/issues/events{/number}","events_url":"https://api.github.com/repos/kakserpom/phpdaemon/events","assignees_url":"https://api.github.com/repos/kakserpom/phpdaemon/assignees{/user}","branches_url":"https://api.github.com/repos/kakserpom/phpdaemon/branches{/branch}","tags_url":"https://api.github.com/repos/kakserpom/phpdaemon/tags","blobs_url":"https://api.github.com/repos/kakserpom/phpdaemon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kakserpom/phpdaemon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kakserpom/phpdaemon/git/refs{/sha}","trees_url":"https://api.github.com/repos/kakserpom/phpdaemon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kakserpom/phpdaemon/statuses/{sha}","languages_url":"https://api.github.com/repos/kakserpom/phpdaemon/languages","stargazers_url":"https://api.github.com/repos/kakserpom/phpdaemon/stargazers","contributors_url":"https://api.github.com/repos/kakserpom/phpdaemon/contributors","subscribers_url":"https://api.github.com/repos/kakserpom/phpdaemon/subscribers","subscription_url":"https://api.github.com/repos/kakserpom/phpdaemon/subscription","commits_url":"https://api.github.com/repos/kakserpom/phpdaemon/commits{/sha}","git_commits_url":"https://api.github.com/repos/kakserpom/phpdaemon/git/commits{/sha}","comments_url":"https://api.github.com/repos/kakserpom/phpdaemon/comments{/number}","issue_comment_url":"https://api.github.com/repos/kakserpom/phpdaemon/issues/comments{/number}","contents_url":"https://api.github.com/repos/kakserpom/phpdaemon/contents/{+path}","compare_url":"https://api.github.com/repos/kakserpom/phpdaemon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kakserpom/phpdaemon/merges","archive_url":"https://api.github.com/repos/kakserpom/phpdaemon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kakserpom/phpdaemon/downloads","issues_url":"https://api.github.com/repos/kakserpom/phpdaemon/issues{/number}","pulls_url":"https://api.github.com/repos/kakserpom/phpdaemon/pulls{/number}","milestones_url":"https://api.github.com/repos/kakserpom/phpdaemon/milestones{/number}","notifications_url":"https://api.github.com/repos/kakserpom/phpdaemon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kakserpom/phpdaemon/labels{/name}","releases_url":"https://api.github.com/repos/kakserpom/phpdaemon/releases{/id}","deployments_url":"https://api.github.com/repos/kakserpom/phpdaemon/deployments","created_at":"2010-03-17T10:48:21Z","updated_at":"2016-05-10T09:33:51Z","pushed_at":"2016-05-13T13:33:16Z","git_url":"git://github.com/kakserpom/phpdaemon.git","ssh_url":"git@github.com:kakserpom/phpdaemon.git","clone_url":"https://github.com/kakserpom/phpdaemon.git","svn_url":"https://github.com/kakserpom/phpdaemon","homepage":"http://daemon.io/","size":8915,"stargazers_count":1265,"watchers_count":1265,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":222,"mirror_url":null,"open_issues_count":18,"forks":222,"open_issues":18,"watchers":1265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235"},"html":{"href":"https://github.com/kakserpom/phpdaemon/pull/235"},"issue":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/issues/235"},"comments":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/kakserpom/phpdaemon/statuses/af1532160ec9a1b0299d35c9481b3d9ed09e2f97"}}}}