added synchronization for port opening
reformatting to fit phpcs