You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Stephen Tyree (JIRA)" <ji...@apache.org> on 2011/03/15 16:03:29 UTC

[jira] Updated: (ZOOKEEPER-1020) Implement function in C client to determine which host you're currently connected to.

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Tyree updated ZOOKEEPER-1020:
-------------------------------------

    Attachment: ZOOKEEPER-1020.patch

Patch to add functionality.

> Implement function in C client to determine which host you're currently connected to.
> -------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1020
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1020
>             Project: ZooKeeper
>          Issue Type: New Feature
>          Components: c client
>            Reporter: Stephen Tyree
>            Priority: Minor
>         Attachments: ZOOKEEPER-1020.patch
>
>
> On occasion it might be useful to determine which host your Zookeeper client is currently connected to, be it for debugging purposes or otherwise. A possible signature for that function:
> const char* zoo_get_connected_host(zhandle_t *zh, char *buffer, size_t buffer_size, unsigned short *port);
> Clients could use it like below:
>   char buffer[33];
>   unsigned short port = 0;
>   if (!zoo_get_connected_host(zh, buffer, sizeof(buffer), &port))
>     return EXIT_FAILURE;
>   printf("The connected host is: %s:%d\n", buffer, port);

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira