Version française
Home     About     Download     Resources     Contact us    
Browse thread
Matching problem?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kiran Pamnany <kiran@c...>
Subject: Re: [Caml-list] Matching problem?
Thanks for the response.

> > ...
> > begin try
> >   syscall (fun () -> Unix.connect s ...
> >   ...
> > with
> >   Unix.Unix_error(UNIX.EINPROGRESS,_,_) -> ...
> >   | Unix.Unix_error(e,_,_) -> ...
> >   | err -> prerr_endline (Printexc.to_string err)
> > done;
> > ...
> >
> > The output for this is:
> >
> > Unix.Unix_error(38, "connect", "")
> >
> > How is this possible?
>
> I am just guessing, but the exception handler for the second case calls
> Unix.close on line 963, which could raise a further exception that would
> not get caught. Also some of the Unix.xxx calls before the begin..try
> block could raise an exception. The odd thing is you're getting
> Unix_error(_, "connect", _), i.e., as if the actual call to Unix.connect
> causes it. By the way, isn't error 38 "function not supported"? What
> does that tell us?
>

It is definitely the connect(). I've put calls to
prerr_endline() calls in each with case.

38 is EINPROGRESS. I've verified this in a couple
of ways. First, the simple client (that works)
causes the first with case to be entered (because
the socket is set to non-blocking, this is the
usual case). The print there outputs 38. Second,
I put a try-with block in xmlRPCClient.ml, around
the call which causes connect_server() to be
invoked. The with case there is written EINPROGRESS
and it catches this exception.

I'm at a loss. I would suspect the code generated
to match the with patterns but this is in a library
and it works with one client and not another.

Any chance this is because of namespace conflict?
What else could cause this behavior?


K


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.