org.vigia.client.communications
Class DataCommunicator

java.lang.Object
  extended by org.vigia.client.communications.DataCommunicator

public class DataCommunicator
extends java.lang.Object

Implements the client data communication.

Author:
jrios

Nested Class Summary
protected  class DataCommunicator.DataCommunicatorReader
          This class reads from the socket and sends the commands to the listeners.
 
Field Summary
protected  java.util.Set<FrameListener> frameListeners
          The registered listeners.
protected  java.net.DatagramSocket socket
          The UDP socket.
 
Constructor Summary
DataCommunicator(int dataPort)
          Creates a data communicator on the port specified.
 
Method Summary
 void addFrameListener(FrameListener frameListener)
          Adds a listener to obtain the frames from the remote camera.
 void close()
          Closes the data communications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

protected java.net.DatagramSocket socket
The UDP socket.


frameListeners

protected java.util.Set<FrameListener> frameListeners
The registered listeners.

Constructor Detail

DataCommunicator

public DataCommunicator(int dataPort)
                 throws java.net.SocketException
Creates a data communicator on the port specified.

Parameters:
dataPort - The data port.
Throws:
java.net.SocketException - Error creating the socket.
Method Detail

addFrameListener

public void addFrameListener(FrameListener frameListener)
Adds a listener to obtain the frames from the remote camera.

Parameters:
frameListener - an implementation of the data listener.

close

public void close()
Closes the data communications.