update README
This commit is contained in:
31
README.md
31
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
|
||||
|
||||
|
||||
28
pom.xml
28
pom.xml
@@ -3,7 +3,17 @@
|
||||
|
||||
<groupId>com.github.nkzawa</groupId>
|
||||
<artifactId>engine.io-client</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<github.global.server>github</github.global.server>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
<url>https://github.com/nkzawa/engine.io-client.java</url>
|
||||
<connection>scm:git:git://github.com/nkzawa/engine.io-client.java.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:nkzawa/engine.io-client.java.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -75,6 +85,22 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.github</groupId>
|
||||
<artifactId>site-maven-plugin</artifactId>
|
||||
<version>0.8</version>
|
||||
<configuration>
|
||||
<message>Creating site for ${project.version}</message>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
<phase>site</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user