MinGW RPC and thread problem
Hans Ole Rafaelsen <[email protected]> Thu, 17 Jul 2008 18:56:09 +0200
| Newsgroups | gmane.comp.lang.ocaml.lib.net.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi
during porting some code from Linux to Windows I have found a couple
of minor issues with the MinGW port of OCamlnet.
Issue 1:
I'm trying to use the RPC modules. This is the problem as far as I can
tell:
Unix.connect call of RPC fails with that operation would block
(Unix.EWOULDBLOCK) in
Uq_engines.class direct_socket_connector()
method connect connaddr ues =
function setup_socket (around line 2291)
changing
...
with
- Unix.Unix_error(Unix.EINPROGRESS,_,_) ->
+ Unix.Unix_error(Unix.EINPROGRESS,_,_)
+ | Unix.Unix_error(Unix.EWOULDBLOCK,_,_) ->
(s,stype,false)
| error ->
(s,stype,false)
...
This fixes the problem of connecting to a running server. However it
does not give the same behavior as under Linux. Under Windows you
don't get any exception that the call would fail. Under Linux you get
connection refused for blocking socket config
(Rpc_client.blocking_socket_config) and for non blocking it reports on
the following receive, trowing Rpc_client.Message_lost. Under Windows
this problem is simply ignored. If the RPC call is synchronous it will
block (forever) and if asynchronous, it will just go through without
reporting any problem, and never calling the callback handle. I don't
know if it is possible to easily fix the last issue due to difference
in Windows and Linux, but the first part need to be fixed in order to
get RPC running under Windows.
Issue 2:
The event system seems to fail if compiled with thread support. It
fails with:
Fatal error: exception Sys_error("Mutex.unlock: error code 120")
Raised at file "", line 0, characters 0-0
I have not digged into this yet. But if you think that this is a bug
(threads are supposed to be supported under Windows) then I can have a
look into this.
I have attached some sample code that demonstrated the two problems.
Thanks,
Hans Ole
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ocamlnet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel
rpc_bug.tgz
(application/x-compressed, 3.2 KB) - not displayed
thread_bug.tgz
(application/x-compressed, 502 B) - not displayed