org.livetribe.slp.spi.net
Class UDPConnector

java.lang.Object
  extended by org.livetribe.slp.spi.net.NetworkConnector
      extended by org.livetribe.slp.spi.net.UDPConnector
Direct Known Subclasses:
SocketUDPConnector

public abstract class UDPConnector
extends NetworkConnector

Version:
$Rev: 200 $ $Date: 2006-08-09 14:17:10 +0200 (Wed, 09 Aug 2006) $

Nested Class Summary
static class UDPConnector.Acceptor
           
 
Field Summary
 
Fields inherited from class org.livetribe.slp.spi.net.NetworkConnector
logger
 
Constructor Summary
UDPConnector()
           
 
Method Summary
 void accept(Runnable executor)
           
protected  void doStart()
           
 int getMaxTransmissionUnit()
           
 InetAddress getMulticastAddress()
           
 int getMulticastTimeToLive()
           
 int getPort()
           
abstract  DatagramSocket multicastSend(DatagramSocket socket, InetSocketAddress address, byte[] bytes)
          Sends the given bytes to the specified multicast address.
 void setMaxTransmissionUnit(int maxTransmissionUnit)
           
 void setMulticastAddress(InetAddress multicastAddress)
           
 void setMulticastTimeToLive(int multicastTimeToLive)
           
 void setPort(int port)
           
abstract  DatagramSocket unicastSend(DatagramSocket socket, InetSocketAddress address, byte[] bytes)
          Sends the given bytes to the given address.
 
Methods inherited from class org.livetribe.slp.spi.net.NetworkConnector
addMessageListener, clearMessageListeners, createAcceptorPool, createAcceptors, createConnectionPool, destroyAcceptors, doStop, getInetAddresses, handle, isRunning, notifyMessageListeners, removeMessageListener, setAcceptorPool, setConnectionPool, setInetAddresses, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPConnector

public UDPConnector()
Method Detail

setMulticastTimeToLive

public void setMulticastTimeToLive(int multicastTimeToLive)

getMulticastTimeToLive

public int getMulticastTimeToLive()

getMaxTransmissionUnit

public int getMaxTransmissionUnit()

setMaxTransmissionUnit

public void setMaxTransmissionUnit(int maxTransmissionUnit)

getMulticastAddress

public InetAddress getMulticastAddress()

setMulticastAddress

public void setMulticastAddress(InetAddress multicastAddress)

getPort

public int getPort()

setPort

public void setPort(int port)

doStart

protected void doStart()
                throws IOException
Overrides:
doStart in class NetworkConnector
Throws:
IOException

unicastSend

public abstract DatagramSocket unicastSend(DatagramSocket socket,
                                           InetSocketAddress address,
                                           byte[] bytes)
                                    throws IOException
Sends the given bytes to the given address.

Parameters:
socket - The datagram socket to be used to send the bytes, or null if the datagram socket must be created
address - The target address to send the bytes to
bytes - The bytes to send
Returns:
The datagram socket passed in, or the newly created one if socket was null
Throws:
IOException - In case of communication errors

multicastSend

public abstract DatagramSocket multicastSend(DatagramSocket socket,
                                             InetSocketAddress address,
                                             byte[] bytes)
                                      throws IOException
Sends the given bytes to the specified multicast address.

Parameters:
socket - The datagram socket to be used to send the bytes, or null if the datagram socket must be created
bytes - The bytes to send
Returns:
The datagram socket passed in, or the newly created one if socket was null
Throws:
IOException - In case of communication errors

accept

public void accept(Runnable executor)
Overrides:
accept in class NetworkConnector


Copyright © 2006-2012 LiveTribe. All Rights Reserved.