-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server shouldnt disconnect when the client does
- Loading branch information
Blake Johnson
committed
Oct 2, 2012
1 parent
43710bb
commit fea744b
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
require 'socket' | ||
puts 'starting up server' | ||
server = TCPServer.new(8080) | ||
session = server.accept | ||
while session = server.accept | ||
puts "connection established from #{session.peeraddr[2]} at | ||
#{session.peeraddr[3]}" | ||
while input = session.gets | ||
puts input | ||
puts input | ||
# session.puts "Server: Welcome #{session.peeraddr[2]}\n" | ||
# puts "log: sending goodbye" | ||
# session.puts "Server: Goodbye\n" | ||
end | ||
end |