rem: DBG("XJAB:xj_jcon_connect: socket [%d]\n", sock);
context: int xj_jcon_connect(xj_jcon jbc){    struct sockaddr_in address;    struct hostent *he;    int sock;    // open connection to server    if((sock = socket(AF_INET, SOCK_STREAM, 0))<0)    {    	DBG("XJAB:xj_jcon_connect: Error to create the socket\n");        return -1;    }    DBG("XJAB:xj_jcon_connect: socket [%d]\n", sock);    he=gethostbyname(jbc->hostname);    if(he == NULL)    {    	DBG("XJAB:xj_jcon_connect: Error getting info about Jabber server"				" address\n");        return -1;    }    // fill the fields of the address    memcpy(&address.sin_addr, he->h_addr, he->h_length);    address.sin_family=AF_INET;    address.sin_port=htons(jbc->port);    // try to connect with JCI server    if (connect(sock, (struct sockaddr *)&address, sizeof(address))<0)    {    	DBG("XJAB:xj_jcon_connect: Error to connect with Jabber server\n");        return -1;    }    jbc->sock = sock;    return 0;}