Skip to content

Commit

Permalink
Switch to using one socket
Browse files Browse the repository at this point in the history
jordansissel committed Dec 31, 2012
1 parent b63cde6 commit f3907ed
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spec/inputs/tcp.rb
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@
output = Shiftback.new do |event|
sequence += 1
begin
insist { event.message } == "Hello ü Û"
insist { event.message } == "Hello ü Û\n"
insist { event.message.encoding } == Encoding.find("UTF-8")
rescue Exception => failure
# Get out of the threads nets
@@ -93,13 +93,11 @@
tcp.run(output)
end
#Send events from clients sockets
client_socket = TCPSocket.new("0.0.0.0", port)
event_count.times do |value|
client_socket = TCPSocket.new("0.0.0.0", port)
client_socket.write "Hello ü Û"
client_socket.close
# micro sleep to ensure sequencing
sleep(0.1)
client_socket.write "Hello ü Û\n"
end
client_socket.close
#wait for input termination
puts "Waiting for tcp input thread to finish"
thread.join

0 comments on commit f3907ed

Please sign in to comment.