public abstract class UdpChannelTransport
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected java.net.InetSocketAddress |
bindAddress |
protected java.net.InetSocketAddress |
connectAddress |
protected java.net.InetSocketAddress |
endPointAddress |
protected org.agrona.concurrent.errors.DistinctErrorLog |
errorLog |
protected org.agrona.concurrent.UnsafeBuffer |
receiveBuffer |
protected java.nio.ByteBuffer |
receiveByteBuffer |
protected java.nio.channels.DatagramChannel |
receiveDatagramChannel |
protected java.nio.channels.SelectionKey |
selectionKey |
protected java.nio.channels.DatagramChannel |
sendDatagramChannel |
protected UdpTransportPoller |
transportPoller |
protected UdpChannel |
udpChannel |
| Constructor and Description |
|---|
UdpChannelTransport(UdpChannel udpChannel,
java.net.InetSocketAddress endPointAddress,
java.net.InetSocketAddress bindAddress,
java.net.InetSocketAddress connectAddress,
org.agrona.concurrent.errors.DistinctErrorLog errorLog) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close transport, canceling any pending read operations and closing channel
|
<T> T |
getOption(java.net.SocketOption<T> name)
Return socket option value
|
boolean |
isMulticast()
Is transport representing a multicast media or unicast
|
boolean |
isValidFrame(org.agrona.concurrent.UnsafeBuffer receiveBuffer,
int length) |
int |
multicastTtl() |
void |
openDatagramChannel()
Create the underlying channel for reading and writing.
|
abstract int |
pollForData()
Attempt to receive waiting data.
|
protected java.net.InetSocketAddress |
receive() |
int |
receiveBufferCapacity()
Return the capacity of the
ByteBuffer used for reception |
java.nio.channels.DatagramChannel |
receiveDatagramChannel()
The
DatagramChannel for this transport channel. |
void |
registerForRead(UdpTransportPoller transportPoller)
Register this transport for reading from a
UdpTransportPoller. |
UdpChannel |
udpChannel()
Return underlying
UdpChannel |
protected java.net.InetSocketAddress bindAddress
protected java.net.InetSocketAddress endPointAddress
protected java.net.InetSocketAddress connectAddress
protected java.nio.channels.SelectionKey selectionKey
protected UdpTransportPoller transportPoller
protected final UdpChannel udpChannel
protected final org.agrona.concurrent.errors.DistinctErrorLog errorLog
protected final java.nio.ByteBuffer receiveByteBuffer
protected final org.agrona.concurrent.UnsafeBuffer receiveBuffer
protected java.nio.channels.DatagramChannel sendDatagramChannel
protected java.nio.channels.DatagramChannel receiveDatagramChannel
public UdpChannelTransport(UdpChannel udpChannel, java.net.InetSocketAddress endPointAddress, java.net.InetSocketAddress bindAddress, java.net.InetSocketAddress connectAddress, org.agrona.concurrent.errors.DistinctErrorLog errorLog)
public void openDatagramChannel()
public void registerForRead(UdpTransportPoller transportPoller)
UdpTransportPoller.transportPoller - to register read withpublic UdpChannel udpChannel()
UdpChannelpublic java.nio.channels.DatagramChannel receiveDatagramChannel()
DatagramChannel for this transport channel.DatagramChannel for this transport channel.public int multicastTtl()
public void close()
close in interface java.lang.AutoCloseablepublic boolean isMulticast()
public <T> T getOption(java.net.SocketOption<T> name)
T - type of optionname - of the socket optionpublic int receiveBufferCapacity()
ByteBuffer used for receptionpublic abstract int pollForData()
public boolean isValidFrame(org.agrona.concurrent.UnsafeBuffer receiveBuffer,
int length)
protected java.net.InetSocketAddress receive()
Copyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.