File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
engine/src/main/battlecode/server Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -151,19 +151,21 @@ public void onOpen(WebSocket client, ClientHandshake handshake) {
151151
152152 @ Override
153153 public void onClose (WebSocket conn , int code , String reason , boolean remote ) {
154- System .out .println ("Closed: " + conn .getRemoteSocketAddress () + " for " + reason );
154+ System .out .println ("Closed: " + conn .getRemoteSocketAddress () + " for " + reason );
155155 }
156156
157157 @ Override
158158 public void onMessage (WebSocket ws , String s ) {
159- System .err .println ("Spurious message from " +
160- ws .getRemoteSocketAddress ()+": `" +s +"`" );
159+ System .err .println ("Spurious message from " + ws .getRemoteSocketAddress () + ": \" " + s + "\" " );
161160 }
162161
163162 @ Override
164163 public void onError (WebSocket conn , Exception ex ) {
165164 if (!(ex instanceof ClosedByInterruptException )) {
166- System .err .println ("Error from: " +conn .getRemoteSocketAddress ()+": " +ex );
165+ if (conn != null )
166+ System .err .println ("Error from " + conn .getRemoteSocketAddress () + ": " + ex );
167+ else
168+ System .err .println ("Error from [unopened WebSocket]: " + ex );
167169 }
168170 }
169171}
You can’t perform that action at this time.
0 commit comments