Created
July 21, 2020 18:57
-
-
Save cmol/a9ea353f7a2faed963d7977d1b8d3b1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "socket" | |
CONNECT_ADDR = "localhost" | |
CONNECT_PORT = 12345 | |
MSG_LENGTH = 256 | |
FLAGS = 0 | |
Addrinfo.udp(CONNECT_ADDR, CONNECT_PORT).connect do |socket| | |
socket.send("Connected via unspecified address family socket", FLAGS) | |
message, server = socket.recvfrom(MSG_LENGTH) | |
puts message | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment