// Get address structure by sock on current side, E.g. you want to know the client port number which randomly assigned
int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
// Get address structure by sock on the other side. E.g. server wants to know client's structure.
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
No comments:
Post a Comment