The type of a socket is 'Socket', not 'socket'.
Add server\socket::__toString().
Use server\socket::__toString().