       @resetPacketId callback
 
   stop: ->
+    @isStopped = true
     @socket.close()
 
   onMessage: (msg, rinfo) ->

    @socket.send buf, 0, buf.length, @serverPort, @serverHost

    setTimeout =>
      if not isACKReceived
        console.warn "resend reset (no ACK received)"
        @resetPacketId callback
    , RESEND_TIMEOUT

    @ackCallbacks = {}
    @serverPort = null
    @serverHost = null
    @isStopped = false

    @socket = dgram.createSocket 'udp4'

