Весёленький комментарий обнаружил
caml_programmer в коде ocamlnet-2.2.4. Автор программы недвусмысленно намекает на бажность продукции компании SWsoft :-)))
let accept_eng() =
let eng = new poll_engine [ Unixqueue.Wait_in sock, (-1.0) ] ues in
new map_engine
~map_done:(fun _ ->
try
let (sock',_) = Unix.accept sock in
Unix.set_nonblock sock';
(* There seem to be buggy kernels out there where
* [accept] does not always return a connected socket.
* We get ENOTCONN for [getpeername] then.
* Who does that? The super hackers at SW-Soft with
* their Virtuozzo shit.
*)
let ps =
try getpeerspec Unix.SOCK_STREAM sock'
with
| Unix.Unix_error(Unix.ENOTCONN,_,_) as e ->
Unix.close sock';
raise e in
acc_engine <- None;
`Done(sock', ps)
with
| Unix.Unix_error( (Unix.EAGAIN | Unix.EINTR |
Unix.ENOTCONN), _, _) ->
eng # restart();
`Working 0
| error ->
`Error error
)
eng
in