This function is called during sendrecv() routine to select
        the available sockets.

        params:
         - sockets: an array of sockets that need to be selected
        returns:
         - an array of sockets that were selected
         - the function to be called next to get the packets (i.g. recv)

def select(sockets, remain=conf.recv_poll_rate):
        """This function is called during sendrecv() routine to select
        the available sockets.

        params:
         - sockets: an array of sockets that need to be selected
        returns:
         - an array of sockets that were selected
         - the function to be called next to get the packets (i.g. recv)
        """
        try:
            inp, _, _ = select(sockets, [], [], remain)
        except (IOError, select_error) as exc:
            # select.error has no .errno attribute
            if exc.args[0] != errno.EINTR:
                raise
        return inp, None