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 instead my machine ip address:


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 instead of my machine IP Address i.e x.x.x.x[/red]

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!