Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/JuliaLang/julia
Browse files Browse the repository at this point in the history
  • Loading branch information
Julia Windows Test Machine committed Apr 23, 2014
2 parents cc7fc96 + c6b2c91 commit 23699c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions base/socket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,13 @@ end

_uv_hook_alloc_buf(sock::UdpSocket,size::Uint) = (c_malloc(size),size)

_recv_start(sock::UdpSocket) = uv_error("recv_start",ccall(:uv_udp_recv_start,Cint,(Ptr{Void},Ptr{Void},Ptr{Void}),
sock.handle,cglobal(:jl_uv_alloc_buf),cglobal(:jl_uv_recvcb)))
function _recv_start(sock::UdpSocket)
if ccall(:uv_is_active,Cint,(Ptr{Void},),sock.handle) == 0
uv_error("recv_start",ccall(:uv_udp_recv_start,Cint,(Ptr{Void},Ptr{Void},Ptr{Void}),
sock.handle,cglobal(:jl_uv_alloc_buf),cglobal(:jl_uv_recvcb)))
end
end

_recv_stop(sock::UdpSocket) = uv_error("recv_stop",ccall(:uv_udp_recv_stop,Cint,(Ptr{Void},),sock.handle))

function recv(sock::UdpSocket)
Expand Down
7 changes: 6 additions & 1 deletion test/socket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ bind(b,ip"127.0.0.1",2135)
c = Condition()
@async begin
@test bytestring(recv(a)) == "Hello World"
notify(c)
# Issue 6505
send(b,ip"127.0.0.1",2134,"Hello World")
@async begin
@test bytestring(recv(a)) == "Hello World"
notify(c)
end
end
send(b,ip"127.0.0.1",2134,"Hello World")
wait(c)
Expand Down

0 comments on commit 23699c4

Please sign in to comment.