From 93f8daae8f655d00283ac4fc52691814c9323ea7 Mon Sep 17 00:00:00 2001 From: patrick cieplak Date: Fri, 31 Mar 2017 00:32:49 +0000 Subject: [PATCH] Fix compilation errors due to deprecated Erlang APIs --- src/sockjs_session.erl | 2 +- src/sockjs_util.erl | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sockjs_session.erl b/src/sockjs_session.erl index 66c5df0..1ed4093 100644 --- a/src/sockjs_session.erl +++ b/src/sockjs_session.erl @@ -14,7 +14,7 @@ -type(handle() :: {?MODULE, {pid(), info()}}). -record(session, {id :: session(), - outbound_queue = queue:new() :: queue(), + outbound_queue = queue:new() :: queue:queue(), response_pid :: pid(), disconnect_tref :: reference(), disconnect_delay = 5000 :: non_neg_integer(), diff --git a/src/sockjs_util.erl b/src/sockjs_util.erl index be3f972..230b672 100644 --- a/src/sockjs_util.erl +++ b/src/sockjs_util.erl @@ -12,13 +12,12 @@ rand32() -> case get(random_seeded) of undefined -> - {MegaSecs, Secs, MicroSecs} = now(), - _ = random:seed(MegaSecs, Secs, MicroSecs), + _ = rand:seed(exsplus, erlang:timestamp()), put(random_seeded, true); _Else -> ok end, - random:uniform(erlang:trunc(math:pow(2,32)))-1. + rand:uniform(erlang:trunc(math:pow(2,32)))-1. -spec encode_frame(frame()) -> iodata().