30 |
|
//---STATIC METHODS--- |
31 |
|
|
32 |
|
//---CONSTRUCTORS--- |
33 |
< |
|
33 |
> |
|
34 |
> |
/** |
35 |
> |
* Construct a new TCPReaderInit. |
36 |
> |
* |
37 |
> |
* @param socket the Socket to which the host is connected |
38 |
> |
* @param queue the Queue to which we'll add data |
39 |
> |
* @throws IOException if something goes badly wrong |
40 |
> |
*/ |
41 |
|
public TCPReaderInit(Socket socket, Queue queue) throws IOException { |
42 |
|
_socket = socket; |
43 |
|
_queue = queue; |
44 |
+ |
// setup the reader & writer |
45 |
|
_socketIn = new BufferedReader(new InputStreamReader(_socket.getInputStream())); |
46 |
|
_socketOut = new PrintWriter(_socket.getOutputStream()); |
47 |
|
_logger.write(toString(), Logger.SYSINIT, "created"); |
48 |
|
} |
49 |
|
|
50 |
|
//---PUBLIC METHODS--- |
51 |
< |
|
51 |
> |
|
52 |
> |
/** |
53 |
> |
* Main run method. Will communicate with the host, inform it |
54 |
> |
* if any updates to it's configuration are needed, and send |
55 |
> |
* a heartbeat packet into the system. |
56 |
> |
*/ |
57 |
|
public void run() { |
58 |
|
try { |
59 |
|
//variables |