Undefined method errors for socket class
code of the form
@sock = UDPSocket.new()
@sock.bind(0, @localport)
@sock.connect(@host, @port)
generates errors of the form
<file>: error: line <line>, column <col>: undefined method bind on an instance of NilClass
<file>: error: line <line>, column <col>: undefined method connect on an instance of NilClass
<file>: error: line <line>, column <col>: undefined method shutdown on an instance of NilClass