[...]
Network.cpp:112: error: invalid conversion from \u2018int*\u2019 to \u2018socklen_t*\u2019
Network.cpp:112: error: initializing argument 6 of \u2018ssize_t recvfrom
(int, void*, size_t, int, sockaddr*, socklen_t*)\u2019
regarding the following piece of code
socklen_t sourceAddressLength = sizeof(struct sockaddr_in);
* messageToReceiveLength = recvfrom(localSocketFd,
messageToReceive,
* messageToReceiveLength,
0,
(struct sockaddr *)
&sourceAddress,
&sourceAddressLength);
I also tried "socklen_t sourceAddressLength =
static_cast<socklen_t> (sizeof(struct sockaddr_in));", but I
get the same errors.
I can't reproduce it on my maching, but a priori, from the
error message, you have a problem with the definition of
socklen_t (which is required by Posix to be an integer type with
at least 32 bits). My guess is that somewhere locally there is
a definition of socklen_t, to something different from what it
is defined as in the Posix header.
--
James Kanze (GABI Software) email:
[email protected]
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34