Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 563 Bytes

File metadata and controls

27 lines (18 loc) · 563 Bytes

Networking

obtain free server port:

int freeServerPort = Net.freeServerPort();

obtain free server port for any host address:

int freeServerPort = Net.freeServerPort(hostAddress);

is localhost an IPv6 address:

boolean isIpv6 = Net.localhostIsIPv6();

create SSLContext to accept any SSL certificate:

HttpsURLConnection connection = (HttpsURLConnection) URLConnections.urlConnectionOf(httpsUrl);
connection.setSSLSocketFactory(Net.acceptAllSSLContext().getSocketFactory());