Project

General

Profile

Bug #7968 ยป socketsendtest.rb

Script to test UDPSocket#send - cs96and (Alan Davies), 02/26/2013 08:55 PM

 
1
require 'socket'
2

    
3
s = UDPSocket.new
4
s.bind("127.0.0.1", 12345)
5
s.connect("127.0.0.1", 23456)
6

    
7
100000.times do
8
	s.send("Hello!", 0)
9
	
10
	# Comment in the send() call above and uncomment the print() call below to improve performance.
11
	#s.print("Hello!")
12
end