Skip to content

Instantly share code, notes, and snippets.

@cmol
Created July 21, 2020 18:57
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 cmol/901169b22a84d8c4e5cc0c1f9c84b520 to your computer and use it in GitHub Desktop.
Save cmol/901169b22a84d8c4e5cc0c1f9c84b520 to your computer and use it in GitHub Desktop.
require "socket"
LISTEN_ADDR = "::"
LISTEN_PORT = 12345
MSG_LENGTH = 256
FLAGS = 0
# Create socket and bind it to the listen on all addresses and the given port
server_socket = UDPSocket.new :INET6
server_socket.bind(LISTEN_ADDR, LISTEN_PORT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment