MCPcopy Create free account
hub / github.com/catabriga/graphwar / run

Method run

src/GraphServer/ClientConnection.java:151–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149 }
150
151 public void run()
152 {
153 running = true;
154
155 while(running)
156 {
157 try
158 {
159 String message = connection.readMessage();
160
161 if(message == null)
162 {
163 server.removeClient(this);
164 disconnect();
165 }
166 else
167 {
168 server.handleMessage(message, this);
169
170 if(checkStayAliveTime())
171 {
172 sendKeepAlive();
173 }
174 }
175 }
176 catch (SocketTimeoutException e)
177 {
178 //e.printStackTrace();
179
180 if(checkTimeout())
181 {
182 server.removeClient(this);
183 disconnect();
184 }
185 else
186 {
187 sendKeepAlive();
188 }
189 }
190 catch (IOException e)
191 {
192 e.printStackTrace();
193
194 server.removeClient(this);
195 disconnect();
196 }
197 }
198 }
199}

Callers

nothing calls this directly

Calls 7

disconnectMethod · 0.95
checkStayAliveTimeMethod · 0.95
sendKeepAliveMethod · 0.95
checkTimeoutMethod · 0.95
readMessageMethod · 0.80
removeClientMethod · 0.45
handleMessageMethod · 0.45

Tested by

no test coverage detected