adresseLocale = InetAddress.getLocalHost(); adresseServeur = InetAddress.getByName("localhost"); adresseServer = InetAddress.getByName("www.univ-valenciennes.fr");
URL monUrl = new URL("http://www.linguee.fr/francais-anglais/"); URLConnection connexion = monUrl.openConnection(); InputStream flux = connexion.getInputStream(); int donneesALire = connexion.getContentLength();for (; donneesALire != 0; donneesALire--) System.out.println((char)flux.read());
flux.close();
Tchaba c du kk đź’©
2 protocoles de communication par sockets :
TCP
UDP