ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostInit.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/filtermanager/HostInit.java (file contents):
Revision 1.15 by tdb, Sun Jan 28 05:38:13 2001 UTC vs.
Revision 1.16 by tdb, Wed Feb 7 13:47:22 2001 UTC

# Line 39 | Line 39 | class HostInit extends Thread {
39          _socket = socket;
40          // setup reader & writer
41          _socketIn = new BufferedReader(new InputStreamReader(_socket.getInputStream()));
42 <        _socketOut = new PrintWriter(_socket.getOutputStream());
42 >        _socketOut = new PrintWriter(_socket.getOutputStream(), true);
43          _logger.write(toString(), Logger.SYSINIT, "created");
44      }
45      
# Line 54 | Line 54 | class HostInit extends Thread {
54              String inBound = _socketIn.readLine();
55              if (!inBound.equals("STARTCONFIG")) {
56                  _socketOut.println("ERROR");
57                _socketOut.flush();
57                  throw new IOException("protocol error - expected:STARTCONFIG got:" + inBound);
58              }
59  
# Line 64 | Line 63 | class HostInit extends Thread {
63                  throw new IOException("error in host configuration");
64              } else {
65                  _socketOut.println("OK");
67                _socketOut.flush();
66                  
67                  // get lastmodified
68                  inBound = _socketIn.readLine();
69                  if(!inBound.equals("LASTMODIFIED")) {
70                          // protocol error
71                      _socketOut.println("ERROR");
74                    _socketOut.flush();
72                      throw new IOException("protocol error - expected:LASTMODIFIED got:" + inBound);
73                  }
74                  else {
75                          // send info
76                          _socketOut.println(myConfig.getLastModified());
80                        _socketOut.flush();
77                  }
78                  
79                  // get config fileList
# Line 85 | Line 81 | class HostInit extends Thread {
81                  if(!inBound.equals("FILELIST")) {
82                          // protocol error
83                      _socketOut.println("ERROR");
88                    _socketOut.flush();
84                      throw new IOException("protocol error - expected:FILELIST got:" + inBound);
85                  }
86                  else {
87                          // send info
88                          _socketOut.println(myConfig.getFileList());
94                        _socketOut.flush();
89                  }
90  
91                  // get properties
# Line 103 | Line 97 | class HostInit extends Thread {
97                          String returnedProperty = myConfig.getProperty("Host."+inBound);    
98                          
99                          _socketOut.println(returnedProperty);
106                        _socketOut.flush();
100      
101                      } catch (org.omg.CORBA.MARSHAL e) {
102                          _socketOut.println("ERROR");
110                        _socketOut.flush();
103                      }
104                      inBound = _socketIn.readLine();
105                  }
106                  _logger.write(toString(), Logger.SYSMSG, "configured host");
107                  _socketOut.println("OK");
116                _socketOut.flush();
108                  
109                  // get filter reference
110                  inBound = _socketIn.readLine();
111                  if(!inBound.equals("FILTER")) {
112                          // protocol error
113                      _socketOut.println("ERROR");
123                    _socketOut.flush();
114                      throw new IOException("protocol error - expected:FILTER got:" + inBound);
115                  }
116                  else {
# Line 131 | Line 121 | class HostInit extends Thread {
121                          _socketOut.println(filter.getHostName() + ";"
122                                           + filter.getUDPPort() + ";"
123                                           + filter.getTCPPort());
134                        _socketOut.flush();
124                  }
125                  
126                  // confirm that all is ok
# Line 139 | Line 128 | class HostInit extends Thread {
128                  if(!inBound.equals("END")) {
129                          // protocol error
130                      _socketOut.println("ERROR");
142                    _socketOut.flush();
131                      throw new IOException("protocol error - expected:END got:" + inBound);
132                  }
133                  else {
134                          // send ok
135                          _socketOut.println("OK");
148                        _socketOut.flush();
136                  }
137  
138              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines