the port number should be defined after memcpy