|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.net.DatagramSocketImpl
com.tangosol.net.TcpDatagramSocket.Impl
public static class TcpDatagramSocket.Impl
Field Summary | |
---|---|
static int |
HEADER_SIZE The fixed header size for packets. |
static int |
PROTOCOL_MAGIC Protcol identifier used to identify that peers are also TcpDatagramSockets. |
Fields inherited from class java.net.DatagramSocketImpl |
---|
fd, localPort |
Fields inherited from interface java.net.SocketOptions |
---|
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY |
Constructor Summary | |
---|---|
TcpDatagramSocket.Impl() |
|
TcpDatagramSocket.Impl(SocketProvider provider) |
Method Summary | |
---|---|
protected void |
bind(int nPort, InetAddress addr) |
protected void |
bind(SocketAddress addr) Bind the socket to the specified address. |
protected void |
close() |
protected void |
closeInbound(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, SocketChannel chan) |
protected void |
closeOutbound(SocketAddress addr) |
protected void |
create() |
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection |
ensureConnection(SocketAddress addr) Obtain a Connection for the specified address. |
protected static SocketException |
ensureSocketException(IOException e) Convert an IOException into a SocketException. |
protected int |
getLocalPort() |
Object |
getOption(int nId) |
protected int |
getTimeToLive() |
protected byte |
getTTL() |
protected void |
join(InetAddress inetaddr) |
protected void |
joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) |
protected void |
leave(InetAddress inetaddr) |
protected void |
leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) |
protected void |
logException(SocketAddress addr, IOException e) Log an exception which is handled internally by the TcpDatagramSocket. |
protected void |
logProtocolWarning(SocketAddress addr, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, int nMagic) Periodically log a warning when connections are made using an unrecogized protocol. |
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection |
makeConnection(SocketAddress addr) Produce a new Connection for the specified destination address |
protected SelectionKey |
nextKey(ByteBuffer buffPacket) Perform a blocking read, waiting for a complete packet. |
protected void |
onAccept(SelectionKey key) Called when a channel is identified as have a new connection to accept. |
protected int |
onConnectionHeader(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, SocketChannel chan) Process a pending connection header. |
protected boolean |
onRead(SelectionKey key, ByteBuffer buffPacket) Called when a channel is detected as readable |
protected int |
peek(InetAddress addr) |
protected int |
peekData(DatagramPacket packet) |
protected void |
processRegistrations() Process any scheduled selector registrations. |
SelectorProvider |
provider() Return the SelectorProvider associated with this socket. |
protected void |
receive(DatagramPacket packet) |
protected void |
scheduleRegistration(SocketChannel chan, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status) Schedule a registration with the selector, and wake it up. |
protected void |
send(DatagramPacket packet) |
void |
setOption(int nId, Object oValue) |
void |
setPacketMagic(int nMagic, int nMask) Specify the packet header which is included at the start of every packet. |
protected void |
setTimeToLive(int ttl) |
protected void |
setTTL(byte ttl) |
String |
toString() |
protected int |
transferBytes(ByteBuffer buffSrc, ByteBuffer buffDst) Transfer bytes from the source to the destination buffer based on their limits. |
Methods inherited from class java.net.DatagramSocketImpl |
---|
connect, disconnect, getFileDescriptor |
Field Detail |
---|
public static final int HEADER_SIZE
public static final int PROTOCOL_MAGIC
Constructor Detail |
---|
public TcpDatagramSocket.Impl() throws SocketException
SocketException
public TcpDatagramSocket.Impl(SocketProvider provider) throws SocketException
SocketException
Method Detail |
---|
public SelectorProvider provider()
public void setPacketMagic(int nMagic, int nMask)
nMagic
- the packet headernMask
- the packet header bitmask identifying the bits used the mask must be in byte incrementsprotected void create() throws SocketException
create
in class DatagramSocketImpl
SocketException
protected void bind(int nPort, InetAddress addr) throws SocketException
bind
in class DatagramSocketImpl
SocketException
protected int getLocalPort()
getLocalPort
in class DatagramSocketImpl
protected void send(DatagramPacket packet) throws IOException
send
in class DatagramSocketImpl
IOException
protected int peek(InetAddress addr) throws IOException
peek
in class DatagramSocketImpl
IOException
protected int peekData(DatagramPacket packet) throws IOException
peekData
in class DatagramSocketImpl
IOException
protected void receive(DatagramPacket packet) throws IOException
receive
in class DatagramSocketImpl
IOException
protected SelectionKey nextKey(ByteBuffer buffPacket) throws IOException
buffPacket
- the packet bufferSocketTimeoutException
- if SO_TIMEOUT is exceededIOException
protected void onAccept(SelectionKey key)
key
- the associated SelectionKeyprotected boolean onRead(SelectionKey key, ByteBuffer buffPacket)
key
- the associated SelectionKeybuffPacket
- a buffer in which to place any available full packetprotected int onConnectionHeader(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, SocketChannel chan) throws IOException
status
- the associated ConnectionStatuschan
- the associated channelIOException
- if an I/O error occursprotected void close()
close
in class DatagramSocketImpl
public void setOption(int nId, Object oValue) throws SocketException
SocketException
public Object getOption(int nId) throws SocketException
SocketException
protected void setTTL(byte ttl) throws IOException
setTTL
in class DatagramSocketImpl
IOException
protected byte getTTL() throws IOException
getTTL
in class DatagramSocketImpl
IOException
protected void setTimeToLive(int ttl) throws IOException
setTimeToLive
in class DatagramSocketImpl
IOException
protected int getTimeToLive() throws IOException
getTimeToLive
in class DatagramSocketImpl
IOException
protected void join(InetAddress inetaddr) throws IOException
join
in class DatagramSocketImpl
IOException
protected void leave(InetAddress inetaddr) throws IOException
leave
in class DatagramSocketImpl
IOException
protected void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException
joinGroup
in class DatagramSocketImpl
IOException
protected void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf) throws IOException
leaveGroup
in class DatagramSocketImpl
IOException
protected void bind(SocketAddress addr) throws SocketException
addr
- the address to bind toSocketException
- if an I/O error occursprotected static SocketException ensureSocketException(IOException e)
e
- the IOExcepotionprotected com.tangosol.net.TcpDatagramSocket.Impl.Connection makeConnection(SocketAddress addr) throws IOException
addr
- the destination addressIOException
- if an I/O error occursprotected com.tangosol.net.TcpDatagramSocket.Impl.Connection ensureConnection(SocketAddress addr) throws IOException
addr
- the destination addressIOException
- if an I/O error occursprotected void closeInbound(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, SocketChannel chan)
protected void closeOutbound(SocketAddress addr)
protected void scheduleRegistration(SocketChannel chan, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status)
chan
- the channel to scheduled registration forstatus
- the associated ConnectionStatus to registerprotected void processRegistrations()
protected int transferBytes(ByteBuffer buffSrc, ByteBuffer buffDst)
buffSrc
- the source bufferbuffDst
- the destination bufferprotected void logException(SocketAddress addr, IOException e)
addr
- the associated addresse
- the exceptionprotected void logProtocolWarning(SocketAddress addr, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, int nMagic)
addr
- the source address of the connectionstatus
- the connection statusnMagic
- the "magic" header they sentpublic String toString()
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |