public class NettyTCPMessageSender extends Object implements MessageSender.IReliable
Channel
to transmit the message.MessageSender.IFast, MessageSender.IReliable
Modifier and Type | Field and Description |
---|---|
private org.jboss.netty.channel.Channel |
channel |
private static DeliveryGuaranty |
DELIVERY_GUARANTY |
Constructor and Description |
---|
NettyTCPMessageSender(org.jboss.netty.channel.Channel channel) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleanup hook which can be called when a session is disconnected or
closed.
|
void |
close(Event closeEvent)
Writes an event mostly the
Events .CLOSE to the client, flushes
all the pending writes and closes the channel. |
void |
closeAfterFlushingPendingWrites(org.jboss.netty.channel.Channel channel,
Event event)
This method will write an event to the channel and then add a close
listener which will close it after the write has completed.
|
org.jboss.netty.channel.Channel |
getChannel() |
DeliveryGuaranty |
getDeliveryGuaranty()
Returns the delivery guaranty of the implementation.
|
Object |
sendMessage(Object message)
This method delegates to the underlying native session object to send a
message to the client.
|
String |
toString() |
private final org.jboss.netty.channel.Channel channel
private static final DeliveryGuaranty DELIVERY_GUARANTY
public NettyTCPMessageSender(org.jboss.netty.channel.Channel channel)
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 org.jboss.netty.channel.Channel getChannel()
public void close()
MessageSender
close
in interface MessageSender
public void close(Event closeEvent)
Events
.CLOSE to the client, flushes
all the pending writes and closes the channel.closeEvent
- public void closeAfterFlushingPendingWrites(org.jboss.netty.channel.Channel channel, Event event)
channel
- event
- Copyright © 2012. All Rights Reserved.