getRemoteName()

Cache the TCP peer address as a string and pass it to createChannel().
This commit is contained in:
Michael Davidsaver
2015-12-08 22:07:26 -05:00
parent 4a1bfff40f
commit b9dd9e8e6c
7 changed files with 32 additions and 23 deletions

View File

@@ -71,6 +71,11 @@ inline int sendto(int s, const char *buf, size_t len, int flags, const struct so
char strBuffer[64];
epicsSocketConvertErrnoToString(strBuffer, sizeof(strBuffer));
LOG(logLevelDebug, "getsockname error: %s.", strBuffer);
_remoteName = "<unknown>:0";
} else {
char strBuffer[64];
sockAddrToA(&_remoteAddress.sa, strBuffer, sizeof(strBuffer));
_remoteName = strBuffer;
}
}