I was able to contact the hose via Mosaic and ftp.
This is pretty NT specific, but all I really did to socketmodule.c is to
change the way makefile worked -- here's what I have now:
---/* s.makefile(mode) method. Create a new open file object referring to a dupped version of the socket's file descriptor. (The dup() call is necessary so that the open file and socket objects may be closed independent of each other.) The mode argument specifies 'r' or 'w' passed to fdopen(). */
static PyObject * BUILD_FUNC_DEF_2(PySocketSock_makefile,PySocketSockObject *,s, PyObject *,args) { extern int fclose PROTO((FILE *)); char *mode; int fd; FILE *fp; if (!PyArg_Parse(args, "s", &mode)) return NULL; #ifdef NT if ((fd = _open_osfhandle ( s->sock_fd, 0 )) < 0 || (fp = fdopen(fd, mode)) == NULL) #else if ((fd = dup(s->sock_fd)) < 0 || (fp = fdopen(fd, mode)) == NULL) #endif return PySocket_Err(); return PyFile_FromFile(fp, "<socket>", mode, fclose); }
---Under NT, socket handles are consider OS handles (i.e. the same type returned by kernel calls lile CreateFile()). The function _open_osfhandle() is provided to take an OS handle and create a C file handle from it. The 0 I am passing in is for READ mode, perhaps I need to spend some more time to see what exactly is doing on there.
rjf
-- | "I don't like being bluffed -- makes me doubt | rjf@aurora.pcg.com | | my perception of reality..." | 71722,3175 | | Chris in the morning on KBHR | | +---------------------------------------------------+-----------------------+