Project

General

Profile

Bug #3510 ยป listen.rb

amiklas (Andrew Miklas), 06/30/2010 05:25 PM

 
1
#!/usr/bin/env ruby
2

    
3
require 'socket'
4

    
5
server = TCPServer.open(3000)
6
loop do
7
  # Simulate a misbehaving HTTP(S) server that accepts connections, but then does nothing.
8
  client = server.accept
9
  puts "Connected"
10
end