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