Subversion Repositories HomeAutomation

Rev

Blame | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  * ServerDataHandler.java
  3.  *
  4.  * Created on den 26 augusti 2003, 00:57
  5.  */
  6. package Macbeth.Net;
  7.  
  8. /**
  9.  * Implement this interface if your class can handle
  10.  * incoming data from the TCP server. This data is
  11.  * always plain text, and thus, your datahandler
  12.  * only needs to be able to handle Strings.
  13.  * @author Jimmy
  14.  */
  15. public interface ServerDataHandler {
  16.  
  17.     /**
  18.      * Will be called when server has received a string
  19.      * that your datahandler need to take care of.
  20.      * @param data The received string.
  21.      */
  22.     public void handleServerData(String data, String address);
  23.  
  24.     /**
  25.      * Notifies your datahandler about a clients remote address.
  26.      * Will be called by server when a new socket is opened.
  27.      * @param address The clients remote address (IP number)
  28.      */
  29.     public void setRemoteAddress(String address);
  30.    
  31.    
  32.     /**
  33.      * Notifies your datahandler about a clients dropping connection.
  34.      * Will be called by server when a client timed out.
  35.      * (did not ping/send data/timed out)
  36.      * @param address The clients remote address (IP number)
  37.      */
  38.     public void clientDropped(String address);
  39. }