public final class SocketBinding extends Object
Modifier and Type | Field and Description |
---|---|
static org.jboss.msc.service.ServiceName |
JBOSS_BINDING_NAME
Deprecated.
use capability injection
|
Constructor and Description |
---|
SocketBinding(String name,
int port,
boolean isFixedPort,
InetAddress multicastAddress,
int multicastPort,
NetworkInterfaceBinding networkInterface,
SocketBindingManager socketBindings,
List<ClientMapping> clientMappings) |
Modifier and Type | Method and Description |
---|---|
DatagramSocket |
createDatagramSocket()
Create and bind a datagram socket.
|
MulticastSocket |
createMulticastSocket()
Create a multicast socket.
|
ServerSocket |
createServerSocket()
Create and bind a server socket
|
ServerSocket |
createServerSocket(int backlog)
Create and bind a server socket.
|
int |
getAbsolutePort()
Unlike the
getPort() method, this method takes into account the port offset, if the port
is not a fixed port and returns the absolute port number which is the sum of the port offset
and the (relative) port. |
InetAddress |
getAddress()
Return the resolved
InetAddress for this binding. |
List<ClientMapping> |
getClientMappings() |
ManagedBinding |
getManagedBinding()
Get the
ManagedBinding associated with this SocketBinding . |
InetAddress |
getMulticastAddress() |
int |
getMulticastPort() |
InetSocketAddress |
getMulticastSocketAddress()
Get the multicast socket address.
|
String |
getName()
Return the name of the SocketBinding used in the configuration
|
NetworkInterfaceBinding |
getNetworkInterfaceBinding()
Return the
NetworkInterfaceBinding for the default interface. |
int |
getPort()
Returns the port configured for this socket binding.
|
InetSocketAddress |
getSocketAddress()
Get the socket address.
|
SocketBindingManager |
getSocketBindings()
Get the socket binding manager.
|
boolean |
isBound()
Check whether this
SocketBinding is bound. |
boolean |
isFixedPort() |
void |
setClientMappings(List<ClientMapping> clientMappings) |
void |
setFixedPort(boolean fixedPort) |
void |
setMulticastAddress(InetAddress multicastAddress) |
void |
setMulticastPort(int multicastPort) |
void |
setPort(int port) |
@Deprecated public static final org.jboss.msc.service.ServiceName JBOSS_BINDING_NAME
public SocketBinding(String name, int port, boolean isFixedPort, InetAddress multicastAddress, int multicastPort, NetworkInterfaceBinding networkInterface, SocketBindingManager socketBindings, List<ClientMapping> clientMappings)
public String getName()
public InetAddress getAddress()
InetAddress
for this binding.public NetworkInterfaceBinding getNetworkInterfaceBinding()
NetworkInterfaceBinding
for the default interface.public SocketBindingManager getSocketBindings()
public InetSocketAddress getSocketAddress()
public InetSocketAddress getMulticastSocketAddress()
public ServerSocket createServerSocket() throws IOException
IOException
public ServerSocket createServerSocket(int backlog) throws IOException
backlog
- the backlogIOException
public DatagramSocket createDatagramSocket() throws SocketException
SocketException
public MulticastSocket createMulticastSocket() throws IOException
IOException
public ManagedBinding getManagedBinding()
ManagedBinding
associated with this SocketBinding
.null
otherwisepublic boolean isBound()
SocketBinding
is bound. All bound sockets
have to be registered at the SocketBindingManager
against which
this check is performed.public int getPort()
getAbsolutePort()
if the port-offset has to be considered.public void setPort(int port)
public boolean isFixedPort()
public void setFixedPort(boolean fixedPort)
public int getMulticastPort()
public void setMulticastPort(int multicastPort)
public InetAddress getMulticastAddress()
public void setMulticastAddress(InetAddress multicastAddress)
public void setClientMappings(List<ClientMapping> clientMappings)
public List<ClientMapping> getClientMappings()
public int getAbsolutePort()
getPort()
method, this method takes into account the port offset, if the port
is not a fixed port and returns the absolute port number which is the sum of the port offset
and the (relative) port.Copyright © 2023 JBoss by Red Hat. All rights reserved.