oop wrapper for php sockets