Updated createClientSocket method