diff options
author | Henrik Nord <[email protected]> | 2016-05-04 12:54:05 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2016-05-04 12:54:05 +0200 |
commit | 91d372e23e1d19bb0c5200ba1682f9e4bc57ed76 (patch) | |
tree | 79eedbd59410d013190e63373b1e7c25d6a7862c /lib/common_test/src/ct_telnet_client.erl | |
parent | 4c8fdca47c9e727dfcc1ab2049ffea35cef76b39 (diff) | |
parent | 1ab69efa960703b86a13ea6ba96f4fd56f1565f9 (diff) | |
download | otp-91d372e23e1d19bb0c5200ba1682f9e4bc57ed76.tar.gz otp-91d372e23e1d19bb0c5200ba1682f9e4bc57ed76.tar.bz2 otp-91d372e23e1d19bb0c5200ba1682f9e4bc57ed76.zip |
Merge branch 'maint-18'
Conflicts:
OTP_VERSION
lib/common_test/test/ct_hooks_SUITE_data/cth/tests/ct_update_config_SUITE.erl
lib/common_test/vsn.mk
Diffstat (limited to 'lib/common_test/src/ct_telnet_client.erl')
-rw-r--r-- | lib/common_test/src/ct_telnet_client.erl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_telnet_client.erl b/lib/common_test/src/ct_telnet_client.erl index f1dee1f3bb..1f1311776f 100644 --- a/lib/common_test/src/ct_telnet_client.erl +++ b/lib/common_test/src/ct_telnet_client.erl @@ -35,7 +35,7 @@ %%-define(debug, true). --export([open/2, open/3, open/4, open/5, close/1]). +-export([open/2, open/3, open/4, open/5, open/6, close/1]). -export([send_data/2, send_data/3, get_data/1]). -define(TELNET_PORT, 23). @@ -70,19 +70,22 @@ -record(state,{conn_name, get_data, keep_alive=true, log_pos=1}). open(Server, ConnName) -> - open(Server, ?TELNET_PORT, ?OPEN_TIMEOUT, true, ConnName). + open(Server, ?TELNET_PORT, ?OPEN_TIMEOUT, true, false, ConnName). open(Server, Port, ConnName) -> - open(Server, Port, ?OPEN_TIMEOUT, true, ConnName). + open(Server, Port, ?OPEN_TIMEOUT, true, false, ConnName). open(Server, Port, Timeout, ConnName) -> - open(Server, Port, Timeout, true, ConnName). + open(Server, Port, Timeout, true, false, ConnName). open(Server, Port, Timeout, KeepAlive, ConnName) -> + open(Server, Port, Timeout, KeepAlive, false, ConnName). + +open(Server, Port, Timeout, KeepAlive, NoDelay, ConnName) -> Self = self(), Pid = spawn(fun() -> init(Self, Server, Port, Timeout, - KeepAlive, ConnName) + KeepAlive, NoDelay, ConnName) end), receive {open,Pid} -> @@ -114,8 +117,8 @@ get_data(Pid) -> %%%----------------------------------------------------------------- %%% Internal functions -init(Parent, Server, Port, Timeout, KeepAlive, ConnName) -> - case gen_tcp:connect(Server, Port, [list,{packet,0},{nodelay,true}], Timeout) of +init(Parent, Server, Port, Timeout, KeepAlive, NoDelay, ConnName) -> + case gen_tcp:connect(Server, Port, [list,{packet,0},{nodelay,NoDelay}], Timeout) of {ok,Sock} -> dbg("~p connected to: ~p (port: ~w, keep_alive: ~w)\n", [ConnName,Server,Port,KeepAlive]), |