unix/win socket bound address

hi, i create a socket, listen on it and bind it to any port with INADDR_ANY, when trying to get the bound address of the socket i get 0.0.0.0 instead my machine ip address:

[code]

struct sockaddr_in serverAddr;
struct sockaddr_in *bound_in_addr;
struct sockaddr boundAddr;


bound_in_addr = (struct sockaddr_in *)&boundAddr;
nBoundPort = ntohs(bound_in_addr->sin_port);
sBoundAddr = (char*)(inet_ntoa(bound_in_addr->sin_addr));

[red]sBoundAddr is equal to 0.0.0.0 instead of my machine IP Address i.e x.x.x.x[/red]
[/code]

Why doesn't it give my the actual ip address?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories