org.apache.mina.common
Interface BroadcastIoSession
- IoSession
public interface BroadcastIoSession
An
IoSession
for broadcast transports. (e.g. UDP broadcast or multicast)
Writing Back to the Broadcasting Server
When you implement a client that receives a broadcast message from a server
such as DHCP server, the client might need to send a response message for the
broadcast message the server sent. Because the remote address of the session
is not the address of the server in case of broadcasting, there should be a
way to specify the destination when you write the response message.
This interface provides
write(Object,SocketAddress)
method so you
can specify the destination.
WriteFuture | write(Object message, SocketAddress destination) - Writes the specified message to the specified destination.
|
close , containsAttribute , getAttachment , getAttribute , getAttributeKeys , getCloseFuture , getConfig , getCreationTime , getFilterChain , getHandler , getIdleCount , getIdleTime , getIdleTimeInMillis , getLastIdleTime , getLastIoTime , getLastReadTime , getLastWriteTime , getLocalAddress , getReadBytes , getReadMessages , getRemoteAddress , getScheduledWriteBytes , getScheduledWriteRequests , getService , getServiceAddress , getServiceConfig , getTrafficMask , getTransportType , getWriteTimeout , getWriteTimeoutInMillis , getWrittenBytes , getWrittenMessages , getWrittenWriteRequests , isClosing , isConnected , isIdle , removeAttribute , resumeRead , resumeWrite , setAttachment , setAttribute , setAttribute , setIdleTime , setTrafficMask , setWriteTimeout , suspendRead , suspendWrite , write |
write
public WriteFuture write(Object message,
SocketAddress destination)
Writes the specified
message to the specified
destination.
This operation is asynchronous;
IoHandler.messageSent(IoSession,Object)
will be invoked when the message is actually sent to remote peer. You can
also wait for the returned
WriteFuture
if you want to wait for
the message actually written.
destination
- null if you want the message sent to the
default remote address