Undo temporary change for memory testing reasons

This commit is contained in:
Joakim Erdfelt 2013-09-09 12:23:50 -07:00
parent aeac72a684
commit 31ff31c8b1
1 changed files with 10 additions and 9 deletions

View File

@ -19,11 +19,13 @@
package org.eclipse.jetty.websocket.jsr356.demo; package org.eclipse.jetty.websocket.jsr356.demo;
import java.io.IOException; import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.websocket.ContainerProvider; import javax.websocket.ContainerProvider;
import javax.websocket.DeploymentException; import javax.websocket.DeploymentException;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer; import javax.websocket.WebSocketContainer;
public class ExampleClient public class ExampleClient
@ -43,14 +45,13 @@ public class ExampleClient
private void run() throws DeploymentException, IOException, URISyntaxException, InterruptedException private void run() throws DeploymentException, IOException, URISyntaxException, InterruptedException
{ {
WebSocketContainer container = ContainerProvider.getWebSocketContainer(); WebSocketContainer container = ContainerProvider.getWebSocketContainer();
TimeUnit.HOURS.sleep(1); ExampleSocket socket = new ExampleSocket();
// ExampleSocket socket = new ExampleSocket(); URI uri = new URI("ws://echo.websocket.org/");
// URI uri = new URI("ws://echo.websocket.org/"); Session session = container.connectToServer(socket,uri);
// Session session = container.connectToServer(socket,uri); socket.writeMessage("Hello");
// socket.writeMessage("Hello"); socket.messageLatch.await(1,TimeUnit.SECONDS); // give remote 1 second to respond
// socket.messageLatch.await(1,TimeUnit.SECONDS); // give remote 1 second to respond session.close();
// session.close(); socket.closeLatch.await(1,TimeUnit.SECONDS); // give remote 1 second to acknowledge response
// socket.closeLatch.await(1,TimeUnit.SECONDS); // give remote 1 second to acknowledge response System.exit(0);
// System.exit(0);
} }
} }