     @socket.bind port, address, callback
 
   stop: ->
+    @isStopped = true
     @socket.close()
 
 

    @sendPacket PACKET_TYPE_REQUIRE_ACK, packetId, buf

    setTimeout =>
      if not isACKReceived
        console.warn "resend #{packetId} (no ACK received)"
        onTimeoutCallback()
    , RESEND_TIMEOUT

      @resetPacketId callback

  stop: ->
    @isStopped = true
    @socket.close()

  onMessage: (msg, rinfo) ->
