07-27-2023, 01:05 AM
I've opened a TCP socket server (I've omitted a few stuff, it is taken from [here][1]
sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol))
Is it possible to get the IP address of the server from sockfd? If not where should I look?
EDIT: I want to know the address of the server (this is before any client connects).
[1]:
sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol))
Is it possible to get the IP address of the server from sockfd? If not where should I look?
EDIT: I want to know the address of the server (this is before any client connects).
[1]:
[To see links please register here]