Unix socket code

Brian Rice water at tunes.org
Mon Jan 31 01:55:57 PST 2005


I've made some extensions to the code, and moved unixsocket.c into 
unix/socket.c. It builds to a nice, tidy, 10kb library.

Right now there's a preliminary select() wrapper and a fancy trick or 
two to make file-descriptor sets appear as Net HandleSets in user-land, 
although the do: protocol is crucially missing. The more basic 
protocols are pretty much solid and covers all of the main unix-style 
API's.

What eventually needs to be done in user-land is to provide for 
Slate-side buffers/queues for the asynchronous I/O, and a system for 
improving the reliability of data sends, since they can often be 
incomplete (signaling the number of bytes sent, of course) if large 
enough. Entailed in this (and probably the do: feature) is an 
IdentityDictionary mapping handles to their ExternalResources, although 
at this point I'd like to deliberately slow down and allow people some 
time to look and figure out what would make the most sense. Feedback 
and additional features or fixes/refactorings of features are welcome.

The relevant files are:
src/lib/net/socket.slate (user-land abstract code)
src/plugins/socket/unix/socket.c (C wrappers)
src/plugins/socket/unixsocket.slate contains the FFI calls and 
BSD-sockets-specific userland.
src/plugins/socket/windows/ is missing an equivalent using the WinSock 
library.

--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/




More information about the Slate mailing list