-
address length help!
is there anything wrong with this?
Code:
int addresslen;
...
addresslen = sizeof(remoteip);
if ((newfd = accept(listen_sock, (struct sockaddr *) &remoteip, &addresslen)) == -1)
{
perror("accept");
}
g++ said that i changed signedness in the 3rd parameter (addresslen). i dont know what this means. thx.
oh the program can compile if i make it
Code:
unsigned int addresslen
but then the program doesnt work!
-
That means that one of the arguments you are passing is signed when you are supposed to pass an unsigned value or visa versa.
Check the function's documentation and see which parameters are supposed to be signed and which are supposed to be unsigned and change the variables accordingly.