fix a bug GetPort() doesn't work under Linux