net.jolsrv2.comm
Class Sender

java.lang.Object
  extended by net.jolsrv2.comm.Sender
All Implemented Interfaces:
java.lang.Runnable

public class Sender
extends java.lang.Object
implements java.lang.Runnable

The class looks for outgoing messages on an Interface, packs as many as possible into a Packet and sends it over a DatagramSocket.

Author:
Andreas Schjønhaug

Constructor Summary
Sender(Interface iface, java.net.InetSocketAddress broadcast)
          Constructor
 
Method Summary
 void run()
          Definition of the run method as required by the Runnable interface The method loops, listening for outgoing messages in the belonging Interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sender

public Sender(Interface iface,
              java.net.InetSocketAddress broadcast)
Constructor

Parameters:
iface - the belonging Interface
broadcast - the broadcast SocketAddress
Method Detail

run

public void run()
Definition of the run method as required by the Runnable interface The method loops, listening for outgoing messages in the belonging Interface. When there one or more messags in the outgoing messages queue, the method packets as many of them as possible into a Packet and sends it over the Interface's DatagramSocket

Specified by:
run in interface java.lang.Runnable
See Also:
Interface