summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
authormax <max@tclers.tk>2014-02-28 10:47:53 (GMT)
committermax <max@tclers.tk>2014-02-28 10:47:53 (GMT)
commit67ca0cb05fe3153db733521fbff66e5ba180358c (patch)
tree95cbd1b26b79322cbabec4f6d4b6756ff54593fb /unix/tclUnixSock.c
parent7b8b2d52e5298c10a227114f17db436bacceb56c (diff)
downloadtcl-67ca0cb05fe3153db733521fbff66e5ba180358c.zip
tcl-67ca0cb05fe3153db733521fbff66e5ba180358c.tar.gz
tcl-67ca0cb05fe3153db733521fbff66e5ba180358c.tar.bz2
Broken intermediate state.
Calling back to CreateClientSocket() from the event loop works, but the final failed or succeeded state of an asyncronous socket does not get notified to the channel correctly.
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 49a6460..c866903 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -163,6 +163,18 @@ static TclInitProcessGlobalValueProc InitializeHostName;
static ProcessGlobalValue hostName =
{0, 0, NULL, NULL, InitializeHostName, NULL, NULL};
+void printaddrinfo(struct addrinfo *addrlist, char *prefix)
+{
+ char host[NI_MAXHOST], port[NI_MAXSERV];
+ struct addrinfo *ai;
+ for (ai = addrlist; ai != NULL; ai = ai->ai_next) {
+ getnameinfo(ai->ai_addr, ai->ai_addrlen,
+ host, sizeof(host),
+ port, sizeof(port),
+ NI_NUMERICHOST|NI_NUMERICSERV);
+ fprintf(stderr,"%s: %s:%s\n", prefix, host, port);
+ }
+}
/*
*----------------------------------------------------------------------
*
@@ -1160,6 +1172,9 @@ Tcl_OpenTcpClient(
return NULL;
}
+ printaddrinfo(myaddrlist, "local");
+ printaddrinfo(addrlist, "remote");
+
/*
* Allocate a new TcpState for this socket.
*/