Explorar o código

Fixed to where server errors happen before the fork.

Lily Carpenter %!s(int64=11) %!d(string=hai) anos
pai
achega
f2197dc9d3
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      ls_echo.rb

+ 1 - 2
ls_echo.rb

@@ -53,9 +53,8 @@ if not directory.directory?
53 53
     raise ArgumentError, "Path #{DIRECTORY} does not represent a valid directory."
54 54
 end
55 55
 
56
-
56
+server = TCPServer.new port
57 57
 fork do
58
-  server = TCPServer.new port
59 58
   Process.daemon
60 59
   loop do
61 60
     Thread.start(server.accept) do |client|