Skip to content

Instantly share code, notes, and snippets.

@ukstv
Created November 18, 2015 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ukstv/6281b5e5e9b15df6995c to your computer and use it in GitHub Desktop.
Save ukstv/6281b5e5e9b15df6995c to your computer and use it in GitHub Desktop.
require 'socket'
address = Addrinfo.tcp('224.0.0.1', 5670)
socket = UDPSocket.open
socket.setsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL, 1)
socket.send("From Sergey with love: " + Time.now.to_s, 0, address.ip_address, address.ip_port)
socket.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment