From e5f26d916a70fe70b85a289623c6bc565d15a786 Mon Sep 17 00:00:00 2001 From: Naoyuki Kanezawa Date: Sun, 5 May 2013 17:59:35 +0900 Subject: [PATCH] update README --- README.md | 31 ++++++++++++++++++++++++++----- pom.xml | 28 +++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a62c339..39ce2d6 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,18 @@ This is the Engine.IO Client Library for Java, which is simply ported from the [client](https://github.com/LearnBoost/engine.io-client) for JavaScript. -## Hello World -Engine.IO-client.java has the similar api with the client for js. You can use `Socket` to connect as follows: +See also: https://github.com/nkzawa/socket.io-client.java + +## Usage +Engine.IO-client.java has the similar api with the js client. You can use `Socket` to connect: ```java -Socket socket = new Socket("ws://localhost") { +socket = new Socket("ws://localhost") { @Override - public void onopen() {} + public void onopen() { + socket.send("hi"); + socket.close(); + } @Override public void onmessage(String data) {} @@ -20,8 +25,24 @@ Socket socket = new Socket("ws://localhost") { socket.open(); ``` +You can receive events as follows: + +```java +socket.on(Socket.EVENT_ERROR, new Emitter.Listener() { + @Override + public void call(Object... args) { + Exception err = (Exception)args[0]; + } +}); +``` + +See the Javadoc for more details. + +http://nkzawa.github.io/engine.io-client.java/apidocs/ + + ## Features -This library supports all of the features the JS client does, including events, options and upgrage, except the Flash transport. +This library supports all of the features the JS client does, including events, options and upgraging transport. ## License diff --git a/pom.xml b/pom.xml index 93fe2db..246c108 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,17 @@ com.github.nkzawa engine.io-client - 0.0.1-SNAPSHOT + 0.1.0-SNAPSHOT + + + github + + + + https://github.com/nkzawa/engine.io-client.java + scm:git:git://github.com/nkzawa/engine.io-client.java.git + scm:git:git@github.com:nkzawa/engine.io-client.java.git + @@ -75,6 +85,22 @@ + + com.github.github + site-maven-plugin + 0.8 + + Creating site for ${project.version} + + + + + site + + site + + +