/*
* Copyright (c) 2011-2017 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/
package io.vertx.core.net;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.net.impl.SocketAddressImpl;
The address of a socket, an inet socket address or a domain socket address.
Use inetSocketAddress(int, String)
to create an inet socket address and domainSocketAddress(String)
to create a domain socket address Author: Tim Fox
/**
* The address of a socket, an inet socket address or a domain socket address.
* <p/>
* Use {@link #inetSocketAddress(int, String)} to create an inet socket address and {@link #domainSocketAddress(String)}
* to create a domain socket address
*
* @author <a href="http://tfox.org">Tim Fox</a>
*/
@VertxGen
public interface SocketAddress {
Create a inet socket address, host
must be non null
and port
must be between 0
and 65536
. Params: - port – the address port
- host – the address host
Returns: the created socket address
/**
* Create a inet socket address, {@code host} must be non {@code null} and {@code port} must be between {@code 0}
* and {@code 65536}.
*
* @param port the address port
* @param host the address host
* @return the created socket address
*/
static SocketAddress inetSocketAddress(int port, String host) {
return new SocketAddressImpl(port, host);
}
Create a domain socket address.
Params: - path – the address path
Returns: the created socket address
/**
* Create a domain socket address.
*
* @param path the address path
* @return the created socket address
*/
static SocketAddress domainSocketAddress(String path) {
return new SocketAddressImpl(path);
}
Returns: the address host or null
for a domain socket
/**
* @return the address host or {@code null} for a domain socket
*/
String host();
Returns: the address port or -1
for a domain socket
/**
* @return the address port or {@code -1} for a domain socket
*/
int port();
Returns: the address path or null
for a inet socket
/**
* @return the address path or {@code null} for a inet socket
*/
String path();
}