Strumenti Utente

Strumenti Sito


roberto.alfieri:user:reti:socket-java

Socket in Java

La classe InetAddress
public class java.net.InetAddress extends java.lang.Object implements Serializable

// Metodi statici
public static InetAddress [] getAllByName (String host) throws UnknownHostException
public static InetAddress getByName (String host) throws UnknownHostException
public static InetAddress getLocalHost () throws UnknownHostException

//Metodi di istanza
public byte [] getAddress ()
public String toString ()
public String getHostAddress ()
public String getHostName ()
public String getCanonicalHostName ()
public boolean isAnyLocalAddress ()
public boolean isLinkLocalAddress ()
public boolean isLoopbackAddress ()
public boolean isMulticastAddress ()
public boolean isMCGlobal ()           // MC = multicast
public boolean is MCLinkLocal ()
public boolean isMCNodeLocal ()
public boolean isMCOrgLocal ()
public boolean isMCSiteLocal ()
public boolean isReachable (int timeout)
public boolean isReachable (NetworkInterface interface, int ttl, int timeout)

esempi

La classe InetSocketAddess
public class java.net.InetSocketAddress extends java.lang.SocketAddress

// Costruttori
InetSocketAddress (InetAddress addr, int port)
InetSocketAddress (int port)
InetSocketAddress (string hostName, int port)

// Metodi di istanza
public InetAddress getAddress ()
public String getHostName ()
public int getPort ()
public boolean isUnresolved ()

Esempi: inetAddressTest.java sockaddresses.java

Esempi di programmazione UDP

Socket in Java e semplice chat

DNSjava

roberto.alfieri/user/reti/socket-java.txt · Ultima modifica: 30/10/2016 21:03 da roberto.alfieri