Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions erts/epmd/test/epmd_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,11 @@ parse_line([$n,$a,$m,$e,$ | Buf0]) ->
{Name, Buf1} ->
case Buf1 of
[$a,$t,$ ,$p,$o,$r,$t,$ | Buf2] ->
case catch list_to_integer(Buf2) of
{'EXIT', _} -> error;
try list_to_integer(Buf2) of
Port -> {ok, {Name, Port}}
catch
_:_ ->
error
end;
_ -> error
end;
Expand All @@ -398,7 +400,13 @@ get_port_nr(Config) when is_list(Config) ->

%% Register with slow write and ask about port nr
slow_get_port_nr(Config) when is_list(Config) ->
port_request([?EPMD_PORT2_REQ,d,$f,d,$o,d,$o]).
%% Pause for 200ms. The packet timeout is 1 second as per ?EPMDARGS defined
%% above.
Pause = {pause, 200},
port_request([?EPMD_PORT2_REQ,
Pause,$f,
Pause,$o,
Pause,$o]).


% Internal function used above
Expand Down Expand Up @@ -1024,9 +1032,8 @@ recv(Sock, Len, Timeout) ->
exit(1)
end.

%% Send data to socket. The list can be non flat and contain
%% the atom 'd' or tuple {d,Seconds} where this is delay
%% put in between the sent characters.
%% Send data to socket. The list can be nested and contain {pause,Milliseconds}
%% to pause that many milliseconds before sending the next character.

send(Sock, SendSpec) ->
case send(SendSpec, [], Sock) of
Expand Down Expand Up @@ -1055,12 +1062,10 @@ send([List | Spec], RevBytes, Sock) when is_list(List) ->
Other ->
Other
end;
send([d | Spec], RevBytes, Sock) ->
send([{d,1000} | Spec], RevBytes, Sock);
send([{d,S} | Spec], RevBytes, Sock) ->
send([{pause, Ms} | Spec], RevBytes, Sock) ->
case send_direct(Sock, lists:reverse(RevBytes)) of
ok ->
timer:sleep(S),
timer:sleep(Ms),
send(Spec, [], Sock);
Any ->
Any
Expand Down
Loading