Skip to content

Commit

Permalink
server shouldnt disconnect when the client does
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Johnson committed Oct 2, 2012
1 parent 43710bb commit fea744b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webserver.rb
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

0 comments on commit fea744b

Please sign in to comment.