net.anotheria.net.udp.client
Class UDPObjectSender

java.lang.Object
  extended by net.anotheria.net.udp.client.UDPObjectSender

public class UDPObjectSender
extends Object

This is a utility class for sending objects over an udp connection. It sneds them over an underlying UDPPacketSender.

Author:
lrosenberg

Constructor Summary
UDPObjectSender(int aSourcePort)
          Creates a new UDPObjectSender bound to a given port.
UDPObjectSender(int aMinPort, int aMaxPort)
          Creates a new UDPObjectSender bound to a first free port in the given port range.
UDPObjectSender(int aMinPort, int aMaxPort, String aDefaultHost, int aDefaultPort)
           
UDPObjectSender(int aSourcePort, String aDefaultHost, int aDefaultPort)
           
 
Method Summary
 void dummy()
           
 void send(Object o)
          Sends an object to the other side.
 void sendTo(Object o, String host, int port)
          Sends an object to specified host and port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDPObjectSender

public UDPObjectSender(int aSourcePort)
Creates a new UDPObjectSender bound to a given port.

Parameters:
aSourcePort - the port to listen to.

UDPObjectSender

public UDPObjectSender(int aMinPort,
                       int aMaxPort)
Creates a new UDPObjectSender bound to a first free port in the given port range.

Parameters:
aMinPort - the minimum port range.
aMaxPort - the maximum port range.

UDPObjectSender

public UDPObjectSender(int aSourcePort,
                       String aDefaultHost,
                       int aDefaultPort)

UDPObjectSender

public UDPObjectSender(int aMinPort,
                       int aMaxPort,
                       String aDefaultHost,
                       int aDefaultPort)
Method Detail

send

public void send(Object o)
          throws IOException
Sends an object to the other side.

Parameters:
o - the object to send.
Throws:
IOException

sendTo

public void sendTo(Object o,
                   String host,
                   int port)
            throws IOException
Sends an object to specified host and port.

Parameters:
o - the object to send.
host - the host to send the object to.
port - the port to send the object to.
Throws:
IOException

dummy

public void dummy()


Copyright © 2010-2013 anotheria.net. All Rights Reserved.