73 |
|
_socketOut.println(PROTOVER); |
74 |
|
_socketOut.flush(); |
75 |
|
_clientName = _socketIn.readLine(); |
76 |
+ |
if(cmd==null) { |
77 |
+ |
throw new IOException("Fatal error reading from client"); |
78 |
+ |
} |
79 |
|
_socketOut.println("OK"); |
80 |
|
_socketOut.flush(); |
81 |
|
} |
90 |
|
while(run) { |
91 |
|
try { |
92 |
|
String cmd = _socketIn.readLine(); |
93 |
+ |
if(cmd==null) { |
94 |
+ |
throw new IOException("Fatal error reading from client"); |
95 |
+ |
} |
96 |
|
// make a decision about what to do |
97 |
|
if(cmd.equals("STARTCONFIG")) { |
98 |
|
// get the configuration for this client |
101 |
|
_socketOut.flush(); |
102 |
|
// get properties |
103 |
|
cmd = _socketIn.readLine(); |
104 |
+ |
if(cmd==null) { |
105 |
+ |
throw new IOException("Fatal error reading from client"); |
106 |
+ |
} |
107 |
|
// provide all the requested properties |
108 |
|
while(!cmd.equals("ENDCONFIG")) { |
109 |
|
// client is restricted to this properties |
123 |
|
_socketOut.flush(); |
124 |
|
} |
125 |
|
cmd = _socketIn.readLine(); |
126 |
+ |
if(cmd==null) { |
127 |
+ |
throw new IOException("Fatal error reading from client"); |
128 |
+ |
} |
129 |
|
} |
130 |
|
_socketOut.println("OK"); |
131 |
|
_socketOut.flush(); |
187 |
|
_socketOut.flush(); |
188 |
|
// read and set the host list |
189 |
|
cmd = _socketIn.readLine(); |
190 |
+ |
if(cmd==null) { |
191 |
+ |
throw new IOException("Fatal error reading from client"); |
192 |
+ |
} |
193 |
|
_hostList = cmd; |
194 |
|
_socketOut.println("OK"); |
195 |
|
_socketOut.flush(); |