Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Unix module API: nonblocking connect's errors retrieving
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-09-22 (13:50)
From: Vsevolod Fedorov <sevaAtWork@m...>
Subject: Unix module API: nonblocking connect's errors retrieving
Hello, Camlers!

I have the following problem when using Unix module:

I issuing 'connect' for nonblocked-mode socket.
This can raise EINPROGRESS error meaning connect is not yet complete.
Then (as I taught by manuals) I use 'select' method and then 'getsockopt_int sock SO_ERROR' to retreive connect results.
The problem is: 'getsockopt_int' returns 'int' while I need Unix.error type.
I can't map int to error in good way.

Of couse, I can use some workarounds (and I had to use one), but they all are not look good.

May be is it the time to extend Unix module API?
For example, add function like 'getsockopt_error' or 'int_to_error'?