You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
320 B
25 lines
320 B
12 years ago
|
require 'socket'
|
||
|
|
||
|
def main
|
||
|
@client = TCPSocket.new('localhost', 11211)
|
||
|
@client.puts ARGV.first
|
||
|
|
||
|
while line = @client.gets
|
||
|
puts line
|
||
|
case line.chomp
|
||
|
when 'END'
|
||
|
break
|
||
|
when 'ERROR'
|
||
|
return 1
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return 0
|
||
|
ensure
|
||
|
@client.close if @client
|
||
|
end
|
||
|
|
||
|
if $0 == __FILE__
|
||
|
exit main
|
||
|
end
|