Hi everyone,
I'm a socket programming newbie. Here's a snippet:
struct sockaddr_storage client_addr;
...
client_addr_size = sizeof(client_addr);
client_socket = accept( server_socket,
(struct sockaddr *)&client_addr, &client_addr_size );
...
result = inet_ntop( AF_INET,
&((struct sockaddr_in *)&client_addr)->sin_addr,
client_addr_str, sizeof(client_addr_str) );
I'm working as a server. Whenever the client connects the address I get is 0.0.0.0 regardless from the host. Can anybody explain, what I'm doing wrong?
Thanks.