Accessing a property of "external" objects without a getter is a little bit risky, since typos are not noticed and it could change in the future. Why not implementing a `Socket::getPort()`?

I also reviewed the complete class and was a little bit confused about `$this->server` which was not initialized in the class but used. This property is also not listed in the class' fields.