diff --git a/src/main/example/ChatServer.java b/src/main/example/ChatServer.java index e1d096d4..96fc6958 100644 --- a/src/main/example/ChatServer.java +++ b/src/main/example/ChatServer.java @@ -94,7 +94,7 @@ public static void main( String[] args ) throws InterruptedException , IOExcepti String in = sysin.readLine(); s.broadcast( in ); if( in.equals( "exit" ) ) { - s.stop(); + s.stop(1000); break; } } diff --git a/src/main/example/ExampleClient.java b/src/main/example/ExampleClient.java index 40ea4e26..48a7f598 100644 --- a/src/main/example/ExampleClient.java +++ b/src/main/example/ExampleClient.java @@ -67,7 +67,7 @@ public void onError( Exception ex ) { } public static void main( String[] args ) throws URISyntaxException { - ExampleClient c = new ExampleClient( new URI( "ws://localhost:8887" ), new Draft_6455() ); // more about drafts here: http://github.com/TooTallNate/Java-WebSocket/wiki/Drafts + ExampleClient c = new ExampleClient( new URI( "ws://localhost:8887" )); // more about drafts here: http://github.com/TooTallNate/Java-WebSocket/wiki/Drafts c.connect(); } diff --git a/src/main/example/FragmentedFramesExample.java b/src/main/example/FragmentedFramesExample.java index b1b82a4c..5d8fbc59 100644 --- a/src/main/example/FragmentedFramesExample.java +++ b/src/main/example/FragmentedFramesExample.java @@ -47,7 +47,7 @@ public class FragmentedFramesExample { public static void main( String[] args ) throws URISyntaxException , IOException , InterruptedException { // WebSocketImpl.DEBUG = true; // will give extra output - WebSocketClient websocket = new ExampleClient( new URI( "ws://localhost:8887" ), new Draft_6455() ); // Draft_6455 is implementation of rfc6455 + WebSocketClient websocket = new ExampleClient( new URI( "ws://localhost:8887" )); if( !websocket.connectBlocking() ) { System.err.println( "Could not connect to the server." ); return; diff --git a/src/main/example/ServerRejectHandshakeExample.java b/src/main/example/ServerRejectHandshakeExample.java index 985f7ef2..dc2f6ff4 100644 --- a/src/main/example/ServerRejectHandshakeExample.java +++ b/src/main/example/ServerRejectHandshakeExample.java @@ -82,7 +82,7 @@ public static void main( String[] args ) throws InterruptedException , IOExcepti String in = sysin.readLine(); s.broadcast( in ); if( in.equals( "exit" ) ) { - s.stop(); + s.stop(1000); break; } } diff --git a/src/main/java/org/java_websocket/client/WebSocketClient.java b/src/main/java/org/java_websocket/client/WebSocketClient.java index bb809da1..29d598fe 100644 --- a/src/main/java/org/java_websocket/client/WebSocketClient.java +++ b/src/main/java/org/java_websocket/client/WebSocketClient.java @@ -481,7 +481,6 @@ public void run() { private void closeOutputAndSocket() { try { if( socket != null ) { - socket.shutdownOutput(); socket.close(); } } catch ( IOException ex ) {