[mercury-users] socket support in io

Paul Massey pma at miscrit.be
Sat Oct 2 01:00:54 AEST 1999


> has anyone done any socket programming in Mercury before?
> There do not appear to be any socket functions in the io
> module; would it make sense for an application to define
> its own in such a way as to allow use of the io routines
> for acting on binary streams?

I put together a networking package a year or so ago and
have been using it since for a web service we developed
using Mercury (see http://www.enix.co.uk for the entry point
into the current instance of the server).

In order to get sockets to fit nicely within the Mercury
environment I had to replace the "io.m" package with a
version which "corrupted" some of the type assumptions.
Basically creating an equality between a socket stream and
an io__stream so the I/O predicates could be used with both
(so no compile time warnings if you try to read from from an
output stream).

I've since modified this package (yet) again to work with a
version of Mercury which we have here which compiles with
the native MS compiler (rather than using CygWin/GCC). The
interface at the mercury level remains the same but the
socket and stream handling has been changed a fair bit.

Depending on which platform you're using I could send you
the files required ? You'll have to rebuild your Mercury
system though ....

Yours,

Paul.

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list