I don't see any way to `automatically' call close on the socket one accepts on. The only solution I see is to either expose that MLton.Socket.t is really a file descriptor which can be passed to Posix.IO.close, or else to have a MLton.Socket.sloce function. The latter is clearly better now, but note that there are all kinds of other things you can do with the socket: make it non-blocking for instance.