zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashwinikgj@gmail.com <ashwini...@gmail.com>
Subject Zookeeper 3.4.12 c client fails to connect to server on solaris 11
Date Wed, 08 Aug 2018 10:07:39 GMT
Hi team,

I compiled zookeeper 3.4.12 c client on solaris 11 machine and trying to test it through cli.sh.
Here is the sample code that I changed in cli.c. Whenever I run the ./cli_mt file it always
throws below error

2018-08-08 09:49:44,437:18000(0x2):ZOO_ERROR@handle_socket_error_msg@1670: Socket []
zk retcode=-4, errno=0(Error 0): connect() call failed. Anybody facing same issue?.

cli.c file

int main(int argc, char **argv) {
#ifndef THREADED
    fd_set rfds, wfds, efds;
    int processed=0;
    char p[2048];
#ifdef YCA  
    char *cert=0;
    char appId[64];
	char buffer[4096];
    int bufoff;
    //FILE *fh;
    struct Stat stat;
    int buflen= sizeof(buffer);
    int rc;

verbose = 0;
    zoo_deterministic_conn_order(1); // enable deterministic order
    hostPort = argv[1];
	printf("\n%s\n", "Lets connect");

    zh = zookeeper_init("sld06hzt:4831", watcher, 30000, &myid, 0, 0);
    if (!zh) {
	printf("\n%d\n", errno);
        return errno;


  rc = zoo_get(zh, "/test", 0, buffer, &buflen, &stat);
if (rc)  
 printf("\n%s\n", buffer);


  return 2;


View raw message