Hello.
I use epoll (kevent) and Socket.sendVecNB:

https://github.com/kni/sml-net-server-ev/blob/3c9dc041e2d46b7ea73f6652435268dd282fc96f/server-stream.sml#L69

    val n       = valOf (Socket.sendVecNB (#sock stream, data)) handle
        exc as OS.SysErr (s, SOME e) =>
          let
            val en = OS.errorName e
          in
            if en = "ECONNRESET" orelse en = "connreset" orelse en =
"EPIPE" orelse en = "pipe" then 0 else raise exc
          end
      | exc => raise exc

See also https://github.com/kni/sml-net-server-ev/


пн, 7 сент. 2020 г. в 10:16, Vijay Mathew <vijay.the.lis...@gmail.com>:
>
> To use the non-blocking functions like acceptNB and sendVecNB, do I need to 
> explicitly set the socket to non-blocking mode? If that is the case, how can 
> I do it?
>
> Are there any documents/examples on how to generally do non-blocking IO in 
> PolyML?
>
> Thank you,
>
> Vijay
> _______________________________________________
> polyml mailing list
> polyml@inf.ed.ac.uk
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to