
Untitled
By: a guest on
Apr 3rd, 2012 | syntax:
CoffeeScript | size: 0.48 KB | hits: 33 | expires: Never
class AresChannelList
constructor: ->
send_to = new Array(
address: "127.0.0.1"
port: 24680
)
sent_to = new Array()
sock = dgram.createSocket "udp4"
loop
if send_to.length > 0
send_to.forEach (obj) ->
try
buf = new Buffer(1)
buf[0] = 2
sock.send buf, 0, buf.length, obj.port, obj.address
sent_to.push obj
catch e
log e
send_to.pop obj
@socket.on "message", (buff) ->
log "aparently got msg.."