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 0A5B77EE99 for ; Tue, 21 Jan 2014 10:59:30 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of anders@fugmann.net) identity=pra; client-ip=90.184.182.235; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="anders@fugmann.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of anders@fugmann.net designates 90.184.182.235 as permitted sender) identity=mailfrom; client-ip=90.184.182.235; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="anders@fugmann.net"; 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@fw.fugmann.net) identity=helo; client-ip=90.184.182.235; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anders@fugmann.net"; x-sender="postmaster@fw.fugmann.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAJJD3lJauLbr/2dsb2JhbABZvG+DB4EldIIlAQEBBDhBEAsYCSUPAkYGDQEHAheHbsQDF45/B4Q4AQOeaYtRgy47 X-IPAS-Result: AqAEAJJD3lJauLbr/2dsb2JhbABZvG+DB4EldIIlAQEBBDhBEAsYCSUPAkYGDQEHAheHbsQDF45/B4Q4AQOeaYtRgy47 X-IronPort-AV: E=Sophos;i="4.95,695,1384297200"; d="scan'208";a="54149516" Received: from 0405ds1-vaer.1.fullrate.dk (HELO fw.fugmann.net) ([90.184.182.235]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 21 Jan 2014 10:59:29 +0100 Received: from [10.0.0.129] (dhcp-129.fugmann.net [10.0.0.129]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fw.fugmann.net (Postfix) with ESMTPSA id ACE1D3D6C47; Tue, 21 Jan 2014 10:59:27 +0100 (CET) Message-ID: <52DE44FF.40206@fugmann.net> Date: Tue, 21 Jan 2014 10:59:27 +0100 From: Anders Peter Fugmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.2.0 MIME-Version: 1.0 To: Goswin von Brederlow CC: caml-list@inria.fr References: <20140113154808.GA21567@frosties> <20140116083541.GA27229@frosties> <52D84944.8090108@fugmann.net> <20140118113316.GA13285@frosties> <52DC086D.2080508@fugmann.net> <20140120091242.GC26447@frosties> In-Reply-To: <20140120091242.GC26447@frosties> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Validation-by: anders@fugmann.net Subject: Re: [Caml-list] Who was working on ocaml bindings for zeromq? Hi Goswin, I cannot reproduce the type problems when mixing different socket types, including dealer socket type, in the polling interface. Can you reproduce the same problems against the Issuu fork of ocaml-zmq, and post an example that exposes the problem? Regards Anders Fugmann On 20/01/14 10:12, Goswin von Brederlow wrote: > Yesterday I actually run into a problem with this. Creating a socket > gave me a odd type (from memory): > > val stream: _[> `Push | `Pull | `Pub | `Sub | `Stream] ZMQ.Socket.t > val dealer: _[> `Push | `Pull | `Pub | `Sub | `Dealer] ZMQ.Socket.t > > A few problems with that: > > 1) A stream socket should be just `Stream. > > 2) Note the _ there. The type is not polymorphic and gives an error > that it can't be unified or something. Don't have the exact error in > memory. > > I think there is something wrong with the way the socket types are > specified that cause this. First time I ever got that kind of error. > > 3) Polling takes an ('a ZMQ.Socket.t, ZMQ.Socket.event) array. Trying > to poll a stream and dealer socket causes type errors. > > I think phantom typed sockets are incompatible with putting them into > an array outside the module. This needs an interface where you have a > poller instance and can add sockets to it one at a time. Internally > the phantom type is known to be "phantom" and the sockets can be put > into an array, hashtbl or list. > > I didn't have time yet to look into those problems. Currently I used > Obj.magic to make it work because I wanted to work on the application > instead of on zmq. But that certainly isn't a solution. > > > So in summary: We need a new polling interface (or phantom typing). > Not just because I don't like it but because it doesn't work for > combining different socket types. > > MfG > Goswin >