Explorar el Código

Fixed to where server errors happen before the fork.

Lily Carpenter hace 11 años
padre
commit
f2197dc9d3
Se han modificado 1 ficheros con 1 adiciones y 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|