From: "gabriele renzi" <[EMAIL PROTECTED]>:

fun serve (socket, host, port) =
let
val lineOpt = Socket.inputLine socket
in
case lineOpt of
  SOME(line) => print line
| NONE      => ()
;
Socket.close socket
end

val port = SOME 8802;
val (socket, port) = Socket.server (port, serve);

which imposes serialization of the requests. Now, if I want to serve
concurrent requests it seem enough to add "spawn" to the serve
declaration.

Is this correct idiomatic code or am I doing something stupid ?


Looks fine to me. Do you experience problems running it?

Cheers,
- Andreas


_______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users

Reply via email to