public static CommunicationClientServer Factory(String hostName, int portNumber)
            throws
            IOException {

        CommunicationClientServer communicationClientServer;
        try {
            InetAddress adresseIP = InetAddress.getByName(hostName);
            Socket clientSocket = new Socket(adresseIP, portNumber);
            clientSocket.setTcpNoDelay(true);
            clientSocket.setKeepAlive(false);
//            clientSocket.setSendBufferSize(0);
            clientSocket.setSoTimeout(1000);
            communicationClientServer = new CommunicationClientServer(clientSocket);
        } catch (UnknownHostException e) {
            System.err.println("Server is unknown: " + hostName);
            throw e;
        } catch (SocketException e) {
            System.err.println("Connexion error / timeout");
            throw e;
        } catch (IOException e) {
            System.err.println("Connexion problem with: " + hostName);
            throw e;
        }
        System.out.println("Connexion OK with: " + hostName);

        return communicationClientServer;
    }