[erlang-questions] Gracefully timeout during erlang:port_call/3?

Ahmed Omar <>
Wed Oct 6 23:25:21 CEST 2010


Not sure if there is a graceful way , but you can spawn the call in a
process that will be terminated after some timeout. This will terminate the
calling process, but if it will affect the port driver depends i guess it
depends on the port

timer:kill_after(Timeout, spawn(erlang, port_call, [Port, Operation,
Data])).

On Mon, Oct 4, 2010 at 1:58 AM, zabrane Mikael <> wrote:

> Hi guys,
>
> Is there a way to gracefully timeout (i.e without crashing the port
> driver) during the synchronous call to "erlang:port_call/3"?
> The idea here is to try to timeout if the port takes long time to return.
>
> Any advice is welcome?
> --
> Regards
> Zabrane
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>


-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>


More information about the erlang-questions mailing list