#include "global.h" #include "mqtt.h" int InitClient(void) { int sock; sock = socket(args->addr.sa.sa_family, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { printf("Error:: socket() #%d - %s\n", errno, strerror(errno)); return -1; } if (connect(sock, &args->addr.sa, args->addr.sa.sa_len) == -1) { printf("Error:: connect() #%d - %s\n", errno, strerror(errno)); return -1; } return sock; } int SendConnect(int sock) { return 0; }