parameters: (conn)
return_statement: return receivedData
docstring: Checks a pipe connection for new messages.
docstring_summary: Checks a pipe connection for new messages.
docstring_tokens: Checks a pipe connection for new messages .
function: def getNewBytes(conn):
      """Checks a pipe connection for new messages."""
      # Check for new messages
      readAttempts = 0
      receivedData = bytearray()
      while readAttempts < 100:
          dataAvailable = conn.poll(0)
          if dataAvailable:
              receivedData += conn.recv_bytes()
          else:
              break
          readAttempts += 1
  
      return receivedData
function_tokens: def getNewBytes ( conn ) : # Check for new messages readAttempts = 0 receivedData = bytearray ( ) while readAttempts < 100 : dataAvailable = conn . poll ( 0 ) if dataAvailable : receivedData += conn . recv_bytes ( ) else : break readAttempts += 1 return receivedData