[self-interest] Re: Sockets

Jecel Assumpcao Jr jecel at lsi.usp.br
Mon Oct 18 21:59:56 UTC 1999


gulle at daimi.au.dk wrote:
> 
> Does anyone know of some tutorial, that could explain how the Socket
> Server etc. in Self works.
> Is there a Socket object in Self ??

The same unixFile objects that are used for normal files can
be used for sockets as well:

   | acceptor. action |

   acceptor: unixFile openTCPListenerOnPort: 8080.
   [ action: acceptor acceptConnection.
     action write:

'<html>
<header>
<title>Not Implemented Yet</title>
</header>
<body>
<h1>Try Again When I Have Finished This Software!</h1>
</body>
</html>'.

     action close
   ] loop

Now try to aim your web browser at the machine you are running
this on, port 8080.

Not quite a working web server, but I how this gives you and idea
of how simple it is.

-- Jecel



More information about the Self-interest mailing list