Im trying to connect to a small server(broker), HiveMQ, with a TCP socket connection. When I ping the server via cmd I get the message:
TCP 0.0.0.0:1883 0.0.0.0:0 LISTENING
The connection code in C is like this:
addr.sin_family = SL_AF_INET;
addr.sin_port = sl_Htons(1883);
addr.sin_addr.s_addr = sl_Htonl("0.0.0.0");
And I get this error:
Error [-111] at line [926] in function [ConnectionToHiveMq]
which indicates an error whith my socket connection:
rc = sl_Connect(mysock, (SlSockAddr_t *) &addr, sizeof(addr));
Can someone help me with this? I have tried many different portnumbers and IP:s but still doesn't work. Itis working if I connect to an application client on the web, where I can subscribe messages from this code. But when Itry with my lokal (broker) server, it dosent...