198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
const char *family = NULL;
Tcl_DString ds;
int result;
if (host != NULL) {
if (Tcl_UtfToExternalDStringEx(interp, NULL, host, -1, 0, &ds,
NULL) != TCL_OK) {
Tcl_DStringFree(&ds);
return 0;
}
native = Tcl_DStringValue(&ds);
}
/*
* Workaround for OSX's apparent inability to resolve "localhost", "0"
|
|
|
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
const char *family = NULL;
Tcl_DString ds;
int result;
if (host != NULL) {
if (Tcl_UtfToExternalDStringEx(interp, NULL, host, -1, 0, &ds,
NULL) != TCL_OK) {
Tcl_DStringFree(&ds);
return 0;
}
native = Tcl_DStringValue(&ds);
}
/*
* Workaround for OSX's apparent inability to resolve "localhost", "0"
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
if (result != 0) {
*errorMsgPtr =
#ifdef EAI_SYSTEM /* Doesn't exist on Windows */
(result == EAI_SYSTEM) ? Tcl_PosixError(interp) :
#endif /* EAI_SYSTEM */
gai_strerror(result);
return 0;
}
/*
* Put IPv4 addresses before IPv6 addresses to maximize backwards
* compatibility of [fconfigure -sockname] output.
*
* There might be more elegant/efficient ways to do this.
|
|
|
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
if (result != 0) {
*errorMsgPtr =
#ifdef EAI_SYSTEM /* Doesn't exist on Windows */
(result == EAI_SYSTEM) ? Tcl_PosixError(interp) :
#endif /* EAI_SYSTEM */
gai_strerror(result);
return 0;
}
/*
* Put IPv4 addresses before IPv6 addresses to maximize backwards
* compatibility of [fconfigure -sockname] output.
*
* There might be more elegant/efficient ways to do this.
|