adding another Python/Java method for reading packet - with timeout