Interface ChannelReceiver
- All Superinterfaces:
Heartbeat
- All Known Implementing Classes:
NioReceiver, ReceiverBase
The
ChannelReceiver interface is the data receiver component at the bottom layer, the IO layer (for
layers see the Channel interface). An implementation of this interface may optionally implement a thread
pool for parallel processing of incoming messages.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintReturns the port the receiver is actually bound to.intReturns the secure port the receiver is actually bound to.intReturns the UDP port the receiver is actually bound to.Return the channel that is related to this ChannelReceivergetHost()String representation of the IPv4 or IPv6 address that this host is listening to.Returns the message listener that is associated with this receiverintgetPort()Returns the listening portintReturns the secure listening portintReturns the UDP portvoidsetChannel(Channel channel) Set the channel that is related to this ChannelReceivervoidsetMessageListener(MessageListener listener) Sets the message listener to receive notification of incoming messages.voidstart()Start listening for incoming messages on the host/portvoidstop()Stop listening for messages
-
Field Details
-
MAX_UDP_SIZE
static final int MAX_UDP_SIZEMaximum UDP packet size.- See Also:
-
-
Method Details
-
start
Start listening for incoming messages on the host/port- Throws:
IOException- Listen failed
-
stop
void stop()Stop listening for messages -
getHost
String getHost()String representation of the IPv4 or IPv6 address that this host is listening to.- Returns:
- the host that this receiver is listening to
-
getPort
int getPort()Returns the listening port- Returns:
- port
-
getBoundPort
int getBoundPort()Returns the port the receiver is actually bound to. This may differ from the configured port if the receiver automatically bound to another port because the configured port was not available.- Returns:
- the bound port, -1 if the non-secure port is not bound
-
getSecurePort
int getSecurePort()Returns the secure listening port- Returns:
- port, -1 if a secure port is not activated
-
getBoundSecurePort
int getBoundSecurePort()Returns the secure port the receiver is actually bound to. This may differ from the configured secure port if the receiver automatically bound to another port because the configured port was not available.- Returns:
- the bound secure port, -1 if the secure port is not bound
-
getUdpPort
int getUdpPort()Returns the UDP port- Returns:
- port, -1 if the UDP port is not activated.
-
getBoundUdpPort
int getBoundUdpPort()Returns the UDP port the receiver is actually bound to. This may differ from the configured UDP port if the receiver automatically bound to another port because the configured port was not available.- Returns:
- the bound UDP port, -1 if the UDP port is not bound
-
setMessageListener
Sets the message listener to receive notification of incoming messages.- Parameters:
listener- MessageListener
-
getMessageListener
MessageListener getMessageListener()Returns the message listener that is associated with this receiver- Returns:
- MessageListener
- See Also:
-
getChannel
-
setChannel
Set the channel that is related to this ChannelReceiver- Parameters:
channel- The channel
-