Skip to content

Commit

Permalink
Give an error if the server was closed while blocked in accept
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Oct 2, 2013
1 parent bd41367 commit 860501f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,7 @@ function accept(server::UVServer, client::AsyncStream)
if server.status != StatusActive
error("accept: Server not connected. Did you `listen`?")
end
@assert client.status == StatusInit
while true
while isopen(server)
err = accept_nonblock(server,client)
if err == 0
return client
Expand All @@ -810,6 +809,7 @@ function accept(server::UVServer, client::AsyncStream)
end
wait(server.connectnotify)
end
error("accept: Server was closed while attempting to accept a client.")
end

const BACKLOG_DEFAULT = 511
Expand Down

0 comments on commit 860501f

Please sign in to comment.