From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 7EC797F730 for ; Thu, 16 Mar 2017 09:23:52 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=kanig@adacore.com; spf=Pass smtp.mailfrom=kanig@adacore.com; spf=None smtp.helo=postmaster@smtp.eu.adacore.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of kanig@adacore.com) identity=pra; client-ip=194.98.77.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kanig@adacore.com"; x-sender="kanig@adacore.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of kanig@adacore.com designates 194.98.77.210 as permitted sender) identity=mailfrom; client-ip=194.98.77.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kanig@adacore.com"; x-sender="kanig@adacore.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.eu.adacore.com) identity=helo; client-ip=194.98.77.210; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kanig@adacore.com"; x-sender="postmaster@smtp.eu.adacore.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AkXIdQxaHPPF8rG65TFpVKZD/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcy8bnLW6fgltlLVR4KTs6sC0LuL9f2xEjVaut7B6ClEK8McEUddyI?= =?us-ascii?q?0/pE8JPo2sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7Mhdp?= =?us-ascii?q?dKyuQtaBx5f/6+fn8JTWZ0BMhSGhSbJ0NhS/6wvL8oEOiJZmbKI4wRvAvlNFd/?= =?us-ascii?q?kQ2GVpOxedlBH5+sr28oQw3T5Xvqdr1clAWKP8cr9wbrVeDTtsezQ27cvqujHK?= =?us-ascii?q?QQKE4WERFG4Rl0wbUED+8BjmU8Kp4WPBve1n1XzCMA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CUAACESspYh9JNYsJdHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBhAeBCoNhiwKQZYxUinkqgkKDLAEJAoNVFAEBAQEBAQEBAQEBEgE?= =?us-ascii?q?BAQoLCQgoL4IzIIJDAQIDIxVRCxgCAgUhAgIPASwNAQ0HEooECrABgiaKVAEBA?= =?us-ascii?q?QcBAQEBAR4FIGuKMoQ+gxyCXwWPW36LbAGGdpYOhmKTSwI2gSVYFUGEaIF+MTU?= =?us-ascii?q?BiUcBAQE?= X-IPAS-Result: =?us-ascii?q?A0CUAACESspYh9JNYsJdHAEBBAEBCgEBFwEBBAEBCgEBhAe?= =?us-ascii?q?BCoNhiwKQZYxUinkqgkKDLAEJAoNVFAEBAQEBAQEBAQEBEgEBAQoLCQgoL4IzI?= =?us-ascii?q?IJDAQIDIxVRCxgCAgUhAgIPASwNAQ0HEooECrABgiaKVAEBAQcBAQEBAR4FIGu?= =?us-ascii?q?KMoQ+gxyCXwWPW36LbAGGdpYOhmKTSwI2gSVYFUGEaIF+MTUBiUcBAQE?= X-IronPort-AV: E=Sophos;i="5.36,170,1486422000"; d="scan'208";a="264792256" Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) ([194.98.77.210]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2017 09:23:51 +0100 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 0565781406; Thu, 16 Mar 2017 09:23:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WPHfs4TqNr-o; Thu, 16 Mar 2017 09:23:50 +0100 (CET) Received: from dprec (openvpn-rw-udp-73.act-europe.fr [10.10.8.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id D1DCB81395; Thu, 16 Mar 2017 09:23:49 +0100 (CET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: caml-list@inria.fr, paul.lachat@edu.univ-fcomte.fr References: <1110622119.7945294.1489651379371.JavaMail.zimbra@edu.univ-fcomte.fr> Date: Thu, 16 Mar 2017 17:23:41 +0900 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Johannes Kanig" Organization: AdaCore Message-ID: In-Reply-To: <1110622119.7945294.1489651379371.JavaMail.zimbra@edu.univ-fcomte.fr> User-Agent: Opera Mail/1.0 (Win32) Subject: Re: [Caml-list] [Question] Named pipe on Windows. Hello Paul, On Thu, 2017-03-16, 17:02:59, wrote: > I need to setup communication between two Ocaml processes on Windows. > I think that using the named pipe of Windows is the good method to do > this task. > > But I can't find any module for Ocaml who allow using the system call of > Windows. > > I have already find this module > https://opam.ocaml.org/packages/named-pipe/, but it use C, > and I would like to avoid depending on another langage than Ocaml or > software like Cygwin. > > Does anybody know a way to use named pipe of Windows in Ocaml ? For the client side, you can simply use Unix.openfile on the pipe name: let name = "\\\\.\\pipe\\" ^ socket_name in Unix.openfile name [Unix.O_RDWR] 0 For the server side, you need to call the Win32 API functions CreateNamedPipe and ConnectNamedPipe, and for that you need to have bindings in C, exactly like the above library does it. I don't think there is another way. -- Johannes Kanig