public class NettyUDPMessageSender extends Object implements MessageSender.Fast
UDPUpstreamHandler
when
a Events.CONNECT
event is received from client. The created instance
of this class is then sent as payload of a DefaultNetworkEvent
to the
Session
.MessageSender.Fast, MessageSender.Reliable
Modifier and Type | Field and Description |
---|---|
private org.jboss.netty.channel.socket.DatagramChannel |
channel |
private static DeliveryGuaranty |
DELIVERY_GUARANTY |
private static org.slf4j.Logger |
LOG |
private SocketAddress |
remoteAddress |
private SessionRegistryService<SocketAddress> |
sessionRegistryService |
Constructor and Description |
---|
NettyUDPMessageSender(SocketAddress remoteAddress,
org.jboss.netty.channel.socket.DatagramChannel channel,
SessionRegistryService<SocketAddress> sessionRegistryService) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Since message sender would have a network connection, it would require
some cleanup.
|
org.jboss.netty.channel.socket.DatagramChannel |
getChannel() |
DeliveryGuaranty |
getDeliveryGuaranty()
Returns the delivery guaranty of the implementation.
|
SocketAddress |
getRemoteAddress() |
protected SessionRegistryService<SocketAddress> |
getSessionRegistryService() |
Object |
sendMessage(Object message)
This method delegates to the underlying native session object to send a
message to the client.
|
String |
toString() |
private static final org.slf4j.Logger LOG
private final SocketAddress remoteAddress
private final org.jboss.netty.channel.socket.DatagramChannel channel
private final SessionRegistryService<SocketAddress> sessionRegistryService
private static final DeliveryGuaranty DELIVERY_GUARANTY
public NettyUDPMessageSender(SocketAddress remoteAddress, org.jboss.netty.channel.socket.DatagramChannel channel, SessionRegistryService<SocketAddress> sessionRegistryService)
public Object sendMessage(Object message)
MessageSender
sendMessage
in interface MessageSender
message
- The message to be sent to client.public DeliveryGuaranty getDeliveryGuaranty()
MessageSender
getDeliveryGuaranty
in interface MessageSender
public void close()
MessageSender
close
in interface MessageSender
public SocketAddress getRemoteAddress()
public org.jboss.netty.channel.socket.DatagramChannel getChannel()
protected SessionRegistryService<SocketAddress> getSessionRegistryService()
Copyright © 2013. All Rights Reserved.