forked from TooTallNate/Java-WebSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleClient.java
More file actions
40 lines (30 loc) · 898 Bytes
/
ExampleClient.java
File metadata and controls
40 lines (30 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.net.URI;
import java.net.URISyntaxException;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_10;
import org.java_websocket.handshake.ServerHandshake;
public class ExampleClient extends WebSocketClient {
public ExampleClient( URI serverUri , Draft draft ) {
super( serverUri, draft );
}
public ExampleClient( URI serverURI ) {
super( serverURI );
}
@Override
public void onOpen( ServerHandshake handshakedata ) {
}
@Override
public void onMessage( String message ) {
}
@Override
public void onClose( int code, String reason, boolean remote ) {
}
@Override
public void onError( Exception ex ) {
}
public static void main( String[] args ) throws URISyntaxException {
ExampleClient c = new ExampleClient( new URI( "ws://localhost:8887" ), new Draft_10() );
c.connect();
}
}