Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.1.0

E18814-01


com.tangosol.net
Class TcpDatagramSocket

java.lang.Object
  extended by java.net.DatagramSocket
      extended by com.tangosol.net.TcpDatagramSocket

Direct Known Subclasses:
NonBlockingTcpDatagramSocket

public class TcpDatagramSocket
extends java.net.DatagramSocket

TCP based datagram socket implementation.

Author:
mf 2009.12.03

Nested Class Summary
static class TcpDatagramSocket.Impl
           

 

Field Summary
static int IO_EXCEPTIONS_LOG_LEVEL
          Debbuging flag for logging an IO exceptions which occur, set to a negative to disable the logging.
protected  TcpDatagramSocket.Impl m_impl
           

 

Constructor Summary
  TcpDatagramSocket()
           
  TcpDatagramSocket(int nPort)
           
  TcpDatagramSocket(int nPort, java.net.InetAddress addr)
           
  TcpDatagramSocket(java.net.SocketAddress addr)
           
  TcpDatagramSocket(SocketProvider provider)
           
protected TcpDatagramSocket(TcpDatagramSocket.Impl impl)
           

 

Method Summary
 void bind(java.net.SocketAddress addr)
          
 boolean isBound()
          
 java.nio.channels.spi.SelectorProvider provider()
          Return the SelectorProvider associated with this socket.
 void receive(java.net.DatagramPacket p)
          
 void send(java.net.DatagramPacket p)
          
 void setAdvanceFrequency(int nAdvance)
          Specify the frequency at which the DatagramSocket will advance over the sub-sockets during receive.
 void setListenBacklog(int n)
          Specify the listen backlog for the server socket.
 void setPacketMagic(int nMagic, int nMask)
          Specify the packet header which is included at the start of every packet.
 void setSocketOptions(java.net.SocketOptions options)
          Specify SocketOptions to be used to configure each of the underlying TCP sockets.
 java.lang.String toString()
          

 

Methods inherited from class java.net.DatagramSocket
close, connect, connect, disconnect, getBroadcast, getChannel, getInetAddress, getLocalAddress, getLocalPort, getLocalSocketAddress, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, isClosed, isConnected, setBroadcast, setDatagramSocketImplFactory, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass

 

Field Detail

IO_EXCEPTIONS_LOG_LEVEL

public static final int IO_EXCEPTIONS_LOG_LEVEL
Debbuging flag for logging an IO exceptions which occur, set to a negative to disable the logging.

m_impl

protected TcpDatagramSocket.Impl m_impl

Constructor Detail

TcpDatagramSocket

public TcpDatagramSocket()
                  throws java.net.SocketException
Throws:
java.net.SocketException

TcpDatagramSocket

public TcpDatagramSocket(java.net.SocketAddress addr)
                  throws java.net.SocketException
Throws:
java.net.SocketException

TcpDatagramSocket

public TcpDatagramSocket(int nPort)
                  throws java.net.SocketException
Throws:
java.net.SocketException

TcpDatagramSocket

public TcpDatagramSocket(int nPort,
                         java.net.InetAddress addr)
                  throws java.net.SocketException
Throws:
java.net.SocketException

TcpDatagramSocket

public TcpDatagramSocket(SocketProvider provider)
                  throws java.io.IOException
Throws:
java.io.IOException

TcpDatagramSocket

protected TcpDatagramSocket(TcpDatagramSocket.Impl impl)

Method Detail

provider

public java.nio.channels.spi.SelectorProvider provider()
Return the SelectorProvider associated with this socket.
Returns:
the SelectorProvider

setSocketOptions

public void setSocketOptions(java.net.SocketOptions options)
                      throws java.net.SocketException
Specify SocketOptions to be used to configure each of the underlying TCP sockets. These options will be added to any previously specified options.
Parameters:
options - the SocketOptions
Throws:
java.net.SocketException - if the options fail to be set

setListenBacklog

public void setListenBacklog(int n)
                      throws java.io.IOException
Specify the listen backlog for the server socket.
Parameters:
n - the depth of the backlog, or <=0 for the OS default.
Throws:
java.io.IOException - if the socket is already bound

setPacketMagic

public void setPacketMagic(int nMagic,
                           int nMask)
                    throws java.io.IOException
Specify the packet header which is included at the start of every packet. Because this implementation is TCP based these headers can be stripped off, and replaced on the far side without consuming any network resources.
Parameters:
nMagic - the packet header
nMask - the packet header bitmask identifying the bits used
Throws:
java.io.IOException - if the socket is already bound

setAdvanceFrequency

public void setAdvanceFrequency(int nAdvance)
Specify the frequency at which the DatagramSocket will advance over the sub-sockets during receive. A higher value will optimize for throughput as well as latency when communicating with a small number of peers. A low value will optimize for latency when communicating with a large number of peers, but is likely to hurt overall throughput.
Parameters:
nAdvance - the packet frequency at which to advance between peers

bind

public void bind(java.net.SocketAddress addr)
          throws java.net.SocketException
Overrides:
bind in class java.net.DatagramSocket
Throws:
java.net.SocketException

isBound

public boolean isBound()
Overrides:
isBound in class java.net.DatagramSocket

send

public void send(java.net.DatagramPacket p)
          throws java.io.IOException
Overrides:
send in class java.net.DatagramSocket
Throws:
java.io.IOException

receive

public void receive(java.net.DatagramPacket p)
             throws java.io.IOException
Overrides:
receive in class java.net.DatagramSocket
Throws:
java.io.IOException

toString

public java.lang.String toString()

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.1.0

E18814-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.