|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-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
A specialized version of DatagramSocketImpl.
| Field Summary | |
|---|---|
static int |
HEADER_SIZEThe fixed header size for packets. |
static int |
PROTOCOL_MAGICProtcol 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()Create a new new Impl. |
|
TcpDatagramSocket.Impl(com.oracle.common.net.SocketProvider provider)Create a new Impl using a provider. |
|
| Method Summary | |
|---|---|
protected void |
bind(int nPort, java.net.InetAddress addr) |
protected void |
bind(java.net.SocketAddress addr)Bind the socket to the specified address. |
protected void |
close() |
protected void |
closeInbound(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, java.nio.channels.SocketChannel chan)Close the inbound channel. |
protected void |
closeOutbound(java.net.SocketAddress addr)Close the outbound socket. |
protected void |
create() |
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection |
ensureConnection(java.net.SocketAddress addr)Obtain a Connection for the specified address. |
protected static java.net.SocketException |
ensureSocketException(java.io.IOException e)Convert an IOException into a SocketException. |
protected int |
getLocalPort() |
java.lang.Object |
getOption(int nId) |
protected int |
getTimeToLive() |
protected byte |
getTTL() |
protected void |
join(java.net.InetAddress inetaddr) |
protected void |
joinGroup(java.net.SocketAddress mcastaddr, java.net.NetworkInterface netIf) |
protected void |
leave(java.net.InetAddress inetaddr) |
protected void |
leaveGroup(java.net.SocketAddress mcastaddr, java.net.NetworkInterface netIf) |
protected void |
logException(java.net.SocketAddress addr, java.io.IOException e)Log an exception which is handled internally by the TcpDatagramSocket. |
protected void |
logProtocolWarning(java.net.SocketAddress addr, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, int nMagic)Periodically log a warning when connections are made using an unrecognized protocol. |
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection |
makeConnection(java.net.SocketAddress addr)Produce a new Connection for the specified destination address. |
protected java.nio.channels.SelectionKey |
nextKey(java.nio.ByteBuffer buffPacket)Perform a blocking read, waiting for a complete packet. |
protected void |
onAccept(java.nio.channels.SelectionKey key)Called when a channel is identified as have a new connection to accept. |
protected boolean |
onConnectionHeader(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status, java.nio.channels.SocketChannel chan)Process a pending connection header. |
protected boolean |
onRead(java.nio.channels.SelectionKey key, java.nio.ByteBuffer buffPacket)Called when a channel is detected as readable. |
protected int |
peek(java.net.InetAddress addr) |
protected int |
peekData(java.net.DatagramPacket packet) |
protected void |
processRegistrations()Process any scheduled selector registrations. |
java.nio.channels.spi.SelectorProvider |
provider()Return the SelectorProvider associated with this socket. |
protected void |
receive(java.net.DatagramPacket packet) |
protected void |
scheduleRegistration(java.nio.channels.SocketChannel chan, com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status)Schedule a registration with the selector, and wake it up. |
protected void |
send(java.net.DatagramPacket packet) |
void |
setOption(int nId, java.lang.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) |
java.lang.String |
toString() |
protected int |
transferBytes(java.nio.ByteBuffer buffSrc, java.nio.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 java.net.SocketException
java.net.SocketException - if any error happens during the bind, or if the port is unavailable
public TcpDatagramSocket.Impl(com.oracle.common.net.SocketProvider provider)
throws java.net.SocketException
provider.
provider - the provider used to create internal socketsjava.net.SocketException - if any error happens during the bind, or if the port is unavailable| Method Detail |
|---|
public java.nio.channels.spi.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 increments
protected void create()
throws java.net.SocketException
create in class java.net.DatagramSocketImpljava.net.SocketException
protected void bind(int nPort,
java.net.InetAddress addr)
throws java.net.SocketException
bind in class java.net.DatagramSocketImpljava.net.SocketExceptionprotected int getLocalPort()
getLocalPort in class java.net.DatagramSocketImpl
protected void send(java.net.DatagramPacket packet)
throws java.io.IOException
send in class java.net.DatagramSocketImpljava.io.IOException
protected int peek(java.net.InetAddress addr)
throws java.io.IOException
peek in class java.net.DatagramSocketImpljava.io.IOException
protected int peekData(java.net.DatagramPacket packet)
throws java.io.IOException
peekData in class java.net.DatagramSocketImpljava.io.IOException
protected void receive(java.net.DatagramPacket packet)
throws java.io.IOException
receive in class java.net.DatagramSocketImpljava.io.IOException
protected java.nio.channels.SelectionKey nextKey(java.nio.ByteBuffer buffPacket)
throws java.io.IOException
buffPacket - the packet bufferjava.net.SocketTimeoutException - if SO_TIMEOUT is exceededjava.io.IOExceptionprotected void onAccept(java.nio.channels.SelectionKey key)
key - the associated SelectionKey
protected boolean onRead(java.nio.channels.SelectionKey key,
java.nio.ByteBuffer buffPacket)
key - the associated SelectionKeybuffPacket - a buffer in which to place any available full packet
protected boolean onConnectionHeader(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status,
java.nio.channels.SocketChannel chan)
throws java.io.IOException
status - the associated ConnectionStatuschan - the associated channeljava.io.IOException - if an I/O error occursprotected void close()
close in class java.net.DatagramSocketImpl
public void setOption(int nId,
java.lang.Object oValue)
throws java.net.SocketException
java.net.SocketException
public java.lang.Object getOption(int nId)
throws java.net.SocketException
java.net.SocketException
protected void setTTL(byte ttl)
throws java.io.IOException
setTTL in class java.net.DatagramSocketImpljava.io.IOException
protected byte getTTL()
throws java.io.IOException
getTTL in class java.net.DatagramSocketImpljava.io.IOException
protected void setTimeToLive(int ttl)
throws java.io.IOException
setTimeToLive in class java.net.DatagramSocketImpljava.io.IOException
protected int getTimeToLive()
throws java.io.IOException
getTimeToLive in class java.net.DatagramSocketImpljava.io.IOException
protected void join(java.net.InetAddress inetaddr)
throws java.io.IOException
join in class java.net.DatagramSocketImpljava.io.IOException
protected void leave(java.net.InetAddress inetaddr)
throws java.io.IOException
leave in class java.net.DatagramSocketImpljava.io.IOException
protected void joinGroup(java.net.SocketAddress mcastaddr,
java.net.NetworkInterface netIf)
throws java.io.IOException
joinGroup in class java.net.DatagramSocketImpljava.io.IOException
protected void leaveGroup(java.net.SocketAddress mcastaddr,
java.net.NetworkInterface netIf)
throws java.io.IOException
leaveGroup in class java.net.DatagramSocketImpljava.io.IOException
protected void bind(java.net.SocketAddress addr)
throws java.net.SocketException
addr - the address to bind tojava.net.SocketException - if an I/O error occursprotected static java.net.SocketException ensureSocketException(java.io.IOException e)
e - the IOExcepotion
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection makeConnection(java.net.SocketAddress addr)
throws java.io.IOException
addr - the destination addressjava.io.IOException - if an I/O error occurs
protected com.tangosol.net.TcpDatagramSocket.Impl.Connection ensureConnection(java.net.SocketAddress addr)
throws java.io.IOException
addr - the destination addressjava.io.IOException - if an I/O error occurs
protected void closeInbound(com.tangosol.net.TcpDatagramSocket.Impl.ConnectionStatus status,
java.nio.channels.SocketChannel chan)
channel.status - the ConnectionStatus corresponding to the channelchan - the channel to closeprotected void closeOutbound(java.net.SocketAddress addr)
addr - the address of the outbound socket
protected void scheduleRegistration(java.nio.channels.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(java.nio.ByteBuffer buffSrc,
java.nio.ByteBuffer buffDst)
buffSrc - the source bufferbuffDst - the destination buffer
protected void logException(java.net.SocketAddress addr,
java.io.IOException e)
addr - the associated addresse - the exception
protected void logProtocolWarning(java.net.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 java.lang.String toString()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||