Package io.aeron.driver.media
Class UdpNameResolutionTransport
java.lang.Object
io.aeron.driver.media.UdpChannelTransport
io.aeron.driver.media.UdpNameResolutionTransport
- All Implemented Interfaces:
AutoCloseable
UdpChannelTransport specialised for name resolution between MediaDrivers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHandler for processing the received frames. -
Field Summary
Fields inherited from class io.aeron.driver.media.UdpChannelTransport
connectAddress, context, errorHandler, receiveDatagramChannel, sendDatagramChannel, udpChannel -
Constructor Summary
ConstructorsConstructorDescriptionUdpNameResolutionTransport(UdpChannel udpChannel, InetSocketAddress resolverAddress, UnsafeBuffer unsafeBuffer, MediaDriver.Context context) Construct a new channel transport for name resolution. -
Method Summary
Modifier and TypeMethodDescriptionTheInetSocketAddresswhich the resolver is bound to for listening to requests.static InetSocketAddressgetInetSocketAddress(String hostAndPort, NameResolver nameResolver) Get theInetSocketAddressfor a host and port endpoint using the default name resolver.static InetSocketAddressgetInterfaceAddress(String addressAndPort) GetInetSocketAddressfor an interface of an address and port.intpoll(UdpNameResolutionTransport.UdpFrameHandler handler, long nowMs) Poll the transport for received frames to be delivered to aUdpNameResolutionTransport.UdpFrameHandler.intsendTo(ByteBuffer buffer, InetSocketAddress remoteAddress) Send contents ofByteBufferto the remote address.Methods inherited from class io.aeron.driver.media.UdpChannelTransport
bindAddressAndPort, close, isMulticast, isValidFrame, multicastTtl, onSendError, openDatagramChannel, receive, receiveDatagramChannel, receiveHook, resendHook, sendError, sendHook, socketRcvbufLength, socketSndbufLength, udpChannel, updateEndpoint
-
Constructor Details
-
UdpNameResolutionTransport
public UdpNameResolutionTransport(UdpChannel udpChannel, InetSocketAddress resolverAddress, UnsafeBuffer unsafeBuffer, MediaDriver.Context context) Construct a new channel transport for name resolution.- Parameters:
udpChannel- associated with the transport.resolverAddress- to listen on.unsafeBuffer- for reading frames.context- for configuration.
-
-
Method Details
-
poll
Poll the transport for received frames to be delivered to aUdpNameResolutionTransport.UdpFrameHandler.- Parameters:
handler- for processing the frames.nowMs- current time.- Returns:
- number of bytes received.
-
sendTo
Send contents ofByteBufferto the remote address.- Parameters:
buffer- to send containing the payload.remoteAddress- to send the payload to.- Returns:
- number of bytes sent.
-
boundAddress
TheInetSocketAddresswhich the resolver is bound to for listening to requests.- Returns:
- the
InetSocketAddresswhich the resolver is bound to for listening to requests.
-
getInterfaceAddress
GetInetSocketAddressfor an interface of an address and port.- Parameters:
addressAndPort- for the endpoint.- Returns:
- the
InetSocketAddressif successful or null if not.
-
getInetSocketAddress
Get theInetSocketAddressfor a host and port endpoint using the default name resolver.- Parameters:
hostAndPort- to parse.nameResolver- to resolve a name to anInetAddress.- Returns:
- the resolved
InetSocketAddressif successful or null if not.
-