Package org.apache.mina.common
Interface BroadcastIoSession
- All Superinterfaces:
IoSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionwrite
(Object message, SocketAddress destination) Writes the specified message to the specified destination.Methods inherited from interface org.apache.mina.common.IoSession
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
-
Method Details
-
write
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 returnedWriteFuture
if you want to wait for the message actually written.- Parameters:
destination
- null if you want the message sent to the default remote address
-