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.
|
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
|
See also: https://github.com/nkzawa/socket.io-client.java
|
||||||
Engine.IO-client.java has the similar api with the client for js. You can use `Socket` to connect as follows:
|
|
||||||
|
## Usage
|
||||||
|
Engine.IO-client.java has the similar api with the js client. You can use `Socket` to connect:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
Socket socket = new Socket("ws://localhost") {
|
socket = new Socket("ws://localhost") {
|
||||||
@Override
|
@Override
|
||||||
public void onopen() {}
|
public void onopen() {
|
||||||
|
socket.send("hi");
|
||||||
|
socket.close();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onmessage(String data) {}
|
public void onmessage(String data) {}
|
||||||
@@ -20,8 +25,24 @@ Socket socket = new Socket("ws://localhost") {
|
|||||||
socket.open();
|
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
|
## 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
|
## License
|
||||||
|
|
||||||
|
|||||||
28
pom.xml
28
pom.xml
@@ -3,7 +3,17 @@
|
|||||||
|
|
||||||
<groupId>com.github.nkzawa</groupId>
|
<groupId>com.github.nkzawa</groupId>
|
||||||
<artifactId>engine.io-client</artifactId>
|
<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>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -75,6 +85,22 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
Reference in New Issue
Block a user