assign the value to port in method read()