Created
September 25, 2012 13:19
-
-
Save gebi/3781773 to your computer and use it in GitHub Desktop.
ssl setopt hang fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssl_setopts(SslSocket, Options) -> | |
Ref = erlang:now(), | |
PPid = self(), | |
Pid = spawn_link(fun() -> | |
ssl:setopts(SslSocket, Options), | |
PPid ! {self(), Ref, ssl_setopts_successful} end), | |
receive | |
{Pid, Ref, ssl_setopts_successful} -> ok | |
after ?SSL_SETOPTS_TIMEOUT -> | |
erlang:exit({error, timeout, {ssl_setopts, Options}}) | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment