-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stevenson Jean-Pierre
committed
May 24, 2015
1 parent
2f30a24
commit 8f1d5d2
Showing
2 changed files
with
113 additions
and
54 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'socket' | ||
BasicSocket.do_not_reverse_lookup = true | ||
# Create socket and bind to address | ||
client = UDPSocket.new | ||
client.bind(nil, 8125) | ||
loop do | ||
data, addr = client.recvfrom(1024) # if this number is too low it will drop the larger packets and never give them to you | ||
puts "From addr: '%s', msg: '%s'" % [addr.join(','), data] | ||
end |