update README
This commit is contained in:
23
README.md
23
README.md
@@ -58,7 +58,26 @@ How to set options:
|
|||||||
opts = new Socket.Options();
|
opts = new Socket.Options();
|
||||||
opts.transports = new String[] {WebSocket.NAME};
|
opts.transports = new String[] {WebSocket.NAME};
|
||||||
|
|
||||||
socket = new Socket("ws://localhost", opts) { ... };
|
socket = new Socket(opts) { ... };
|
||||||
|
```
|
||||||
|
|
||||||
|
Sending and receiving binary data:
|
||||||
|
|
||||||
|
```java
|
||||||
|
socket = new Socket() {
|
||||||
|
@Override
|
||||||
|
public void onopen() {
|
||||||
|
// send binary data
|
||||||
|
byte[] data = new byte[42];
|
||||||
|
socket.send(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onmessage(byte[] data) {
|
||||||
|
// receive binary data
|
||||||
|
}
|
||||||
|
...
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### Extra features only for Java client
|
### Extra features only for Java client
|
||||||
@@ -98,7 +117,7 @@ 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 upgraging transport. Android is fully supported.
|
This library supports all of the features the JS client does, including events, options and upgrading transport. Android is fully supported.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user