Undefined method `recvfrom_nonblock' for #<UDPSocket:0x1d96b


I am using jruby 1.3.1 and deploying my app in JBoss. I am getting
following error while trying to connect to a UDP server:

NoMethodError: undefined method `recvfrom_nonblock’ for

And here is my code:

require “socket”
require “timeout”

s = UDPSocket::new
s.connect(server, port)
s.send(my_message, 0)
IO.select([s],nil,nil, 3)
res = s.recvfrom_nonblock(200)
rescue Exception => e
puts “Exception : #{e.inspect}”

Can anybody give me any idea what is wrong?