public interface BroadcastIoSession extends IoSession
IoSession
for broadcast transports. (e.g. UDP broadcast or multicast)
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(java.lang.Object message,
java.net.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
WriteFuture write(java.lang.Object message, java.net.SocketAddress destination)
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