diff options
author | Lukas Larsson <[email protected]> | 2011-12-02 17:13:49 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-12-05 19:39:40 +0100 |
commit | 250a556b1e3eb8486ec294f94d3b918c9ac91542 (patch) | |
tree | c3d8795be62b7b349aae6aec92f6f8d1583415db /lib | |
parent | 62fffa75e2003b3f19eb7614307942028a400fd1 (diff) | |
download | otp-250a556b1e3eb8486ec294f94d3b918c9ac91542.tar.gz otp-250a556b1e3eb8486ec294f94d3b918c9ac91542.tar.bz2 otp-250a556b1e3eb8486ec294f94d3b918c9ac91542.zip |
Make solaris use sendfilev
sendfilev is a richer API which allows us to
do non blocking TCP on solaris. The normal
sendfile API seems to have some issue with
non blocking sockets and the return value of
sendfile.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kernel/test/sendfile_SUITE.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/kernel/test/sendfile_SUITE.erl b/lib/kernel/test/sendfile_SUITE.erl index 04af16a6b9..1b5119c684 100644 --- a/lib/kernel/test/sendfile_SUITE.erl +++ b/lib/kernel/test/sendfile_SUITE.erl @@ -99,7 +99,7 @@ t_sendfile_big(Config) when is_list(Config) -> Size end, - ok = sendfile_send("localhost", Send, 0). + ok = sendfile_send({127,0,0,1}, Send, 0). t_sendfile_partial(Config) -> Filename = proplists:get_value(small_file, Config), @@ -185,14 +185,14 @@ t_sendfile_sendduring(Config) -> {ok, #file_info{size = Size}} = file:read_file_info(Filename), spawn_link(fun() -> - timer:sleep(10), + timer:sleep(50), ok = gen_tcp:send(Sock, <<2>>) end), {ok, Size} = file:sendfile(Filename, Sock), Size+1 end, - ok = sendfile_send("localhost", Send, 0). + ok = sendfile_send({127,0,0,1}, Send, 0). t_sendfile_recvduring(Config) -> Filename = proplists:get_value(big_file, Config), @@ -201,7 +201,7 @@ t_sendfile_recvduring(Config) -> {ok, #file_info{size = Size}} = file:read_file_info(Filename), spawn_link(fun() -> - timer:sleep(10), + timer:sleep(50), ok = gen_tcp:send(Sock, <<1>>), {ok,<<1>>} = gen_tcp:recv(Sock, 1) end), @@ -210,11 +210,11 @@ t_sendfile_recvduring(Config) -> Size+1 end, - ok = sendfile_send("localhost", Send, 0). + ok = sendfile_send({127,0,0,1}, Send, 0). %% TODO: consolidate tests and reduce code sendfile_send(Send) -> - sendfile_send("localhost",Send). + sendfile_send({127,0,0,1},Send). sendfile_send(Host, Send) -> sendfile_send(Host, Send, []). sendfile_send(Host, Send, Orig) -> @@ -245,7 +245,6 @@ sendfile_server(ClientPid, Orig) -> gen_tcp:send(Sock, <<1>>). -define(SENDFILE_TIMEOUT, 10000). -%% f(),{ok, S} = gen_tcp:connect("localhost",7890,[binary]),file:sendfile("/ldisk/lukas/otp/sendfiletest.dat",S). sendfile_do_recv(Sock, Bs) -> receive {tcp, Sock, B} -> |