org.livetribe.slp.spi.net
Class SocketUDPConnector

java.lang.Object
  extended by org.livetribe.slp.spi.net.NetworkConnector
      extended by org.livetribe.slp.spi.net.UDPConnector
          extended by org.livetribe.slp.spi.net.SocketUDPConnector

public class SocketUDPConnector
extends UDPConnector

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.livetribe.slp.spi.net.UDPConnector
UDPConnector.Acceptor
 
Field Summary
 
Fields inherited from class org.livetribe.slp.spi.net.NetworkConnector
logger
 
Constructor Summary
SocketUDPConnector()
           
 
Method Summary
protected  Runnable[] createAcceptors()
           
protected  void destroyAcceptors()
           
 DatagramSocket multicastSend(DatagramSocket socket, InetSocketAddress address, byte[] bytes)
          Sends the given bytes to the specified multicast address.
 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.UDPConnector
accept, doStart, getMaxTransmissionUnit, getMulticastAddress, getMulticastTimeToLive, getPort, setMaxTransmissionUnit, setMulticastAddress, setMulticastTimeToLive, setPort
 
Methods inherited from class org.livetribe.slp.spi.net.NetworkConnector
addMessageListener, clearMessageListeners, createAcceptorPool, createConnectionPool, 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

SocketUDPConnector

public SocketUDPConnector()
Method Detail

createAcceptors

protected Runnable[] createAcceptors()
                              throws IOException
Specified by:
createAcceptors in class NetworkConnector
Throws:
IOException

destroyAcceptors

protected void destroyAcceptors()
                         throws IOException
Specified by:
destroyAcceptors in class NetworkConnector
Throws:
IOException

unicastSend

public DatagramSocket unicastSend(DatagramSocket socket,
                                  InetSocketAddress address,
                                  byte[] bytes)
                           throws IOException
Description copied from class: UDPConnector
Sends the given bytes to the given address.

Specified by:
unicastSend in class UDPConnector
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 DatagramSocket multicastSend(DatagramSocket socket,
                                    InetSocketAddress address,
                                    byte[] bytes)
                             throws IOException
Description copied from class: UDPConnector
Sends the given bytes to the specified multicast address.

Specified by:
multicastSend in class UDPConnector
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


Copyright © 2006-2012 LiveTribe. All Rights Reserved.