[plt-scheme] FFI - C file handles -> scheme ports

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Jan 14 18:02:34 EST 2007

At Sun, 14 Jan 2007 22:47:51 +0100, Hans Oesterholt-Dijkema wrote:
> 
> > If I understand, then the question is Windows-specific.
> >
> > Under Unix, a socket is a file descriptor, and
> > scheme_make_fd_input_port() is ok. Under Windows,
> > scheme_make_fd_input_port() actually works with file handles, which
> > have the C type HANDLE, and it does not work with Windows sockets.
> >
> > So, I think the question is whether there's anything exported by
> > MzScheme's C API that is like scheme_make_fd_input_port() but for
> > Windows sockets.
> >
> > Internally, there is such a function. It's not currently exposed in the
> > C API. Would it be useful for me to change MzScheme so that it's
> > exposed?
> >   
> That's exactly what I was hoping for.

I've added

 void scheme_socket_to_ports(long s, const char *name, int close,
                             Scheme_Object **inp, Scheme_Object **outp);

for version 369.5.

Matthew



Posted on the users mailing list.