 #
 # Input Port (inport) implementation for NoFlo components. These
 # ports are the way a component receives Information Packets.
-class InPort extends BasePort
+module.exports = class InPort extends BasePort
   constructor: (options = {}) ->
     options.control ?= false
     options.scoped ?= true

      @handleSocketEvent 'disconnect', socket, localId
    socket.on 'ip', (ip) =>
      @handleIP ip, localId

  handleIP: (ip, id) ->
    return if @options.control and ip.type isnt 'data'

      idx = null
    return true if @hasIPinBuffer scope, idx, validate
    return true if @hasIIP idx, validate
    return false

  # Returns the number of data packets in an inport
  length: (scope, idx) ->
