Created
December 5, 2016 05:12
-
-
Save ChunChunMorning/f6f3e8141ee5697e2173d962a69cfac9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "socket" | |
server = TCPServer.open("127.0.0.1", 50000); | |
puts "Server is running at 50000." | |
loop { | |
begin | |
parent = server.accept(); | |
# 省略 | |
threads.each { |thread| | |
thread.join(); | |
} | |
rescue | |
parent.close(); | |
child.close(); | |
puts("Game End"); | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment