code: def nonblock_recv(self):
          
  
          if self.buffered_frames():
              # Get a frame from the buffer
              return self.get_frame()
  
          # Set the non blocking flag, read from the socket, and unset the flag
          self.set_nonblock(True)
          pkt = L2bpfListenSocket.recv(self)
          self.set_nonblock(False)
          return pkt
docs: Non blocking receive