Showing
2 changed files
with
8 additions
and
1 deletions
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | |
30 | 30 | |
31 | 31 | void |
32 | -socketConnect(Sock this, const char * addr) | |
32 | +socketConnect(Sock this, const char * addr, char (*remoteAddr)[16]) | |
33 | 33 | { |
34 | 34 | inet_pton(AF_INET, addr, &((this->addr).sin_addr)); |
35 | 35 | (this->addr).sin_family = AF_INET; // Internet address family |
... | ... | @@ -44,6 +44,11 @@ socketConnect(Sock this, const char * addr) |
44 | 44 | "error connection socket: %s - service terminated", |
45 | 45 | strerror(errno)); |
46 | 46 | exit(EXIT_FAILURE); |
47 | + } else { | |
48 | + strcpy(*remoteAddr, inet_ntoa((sock->addr).sin_addr)); | |
49 | + | |
50 | + loggerLog(this->log, LOGGER_INFO, | |
51 | + "handling connection %s\n", inet_ntoa((sock->addr).sin_addr)); | |
47 | 52 | } |
48 | 53 | } |
49 | 54 | ... | ... |
Please
register
or
login
to post a comment