File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11# RxSocketClient
22
3- [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( https://github.com/codeestX/RxSocketClient/pulls ) [ ![ API] ( https://img.shields.io/badge/API-20%2B-brightgreen.svg )] ( https://android-arsenal.com/api?level=20 ) [ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
3+ [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( https://github.com/codeestX/RxSocketClient/pulls ) [ ![ API] ( https://img.shields.io/badge/API-20%2B-brightgreen.svg )] ( https://android-arsenal.com/api?level=20 ) [ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://opensource.org/licenses/Apache-2.0 )
44
5- RxSocketClient, Reactive Socket APIs for Android, Java and Kotlin, powered by RxJava2
5+ RxSocketClient, Reactive Socket APIs for Android, Java and Kotlin, powered by RxJava2
66RxSocketClient,支持Android,Java和Kotlin的响应式Socket APIs封装,基于RxJava2
77
88RxJava2 Version: 2.1.1
99
1010# Usage
1111
1212### init
13- ```
13+ ``` java
1414SocketClient mClient = RxSocketClient
1515 .create(new SocketConfig .Builder ()
1616 .setIp(IP )
@@ -38,8 +38,9 @@ SocketClient mClient = RxSocketClient
3838| Tail | Optional | appending bytes at last when sending data, not included heartbeat |
3939
4040### connect
41- ```
41+ ``` java
4242Disposable ref = mClient. connect()
43+ ... // anything else what you can do with RxJava
4344 .observeOn(AndroidSchedulers . mainThread())
4445 .subscribe(new SocketSubscriber () {
4546 @Override
@@ -61,14 +62,14 @@ Disposable ref = mClient.connect()
6162```
6263
6364### disconnect
64- ```
65+ ``` java
6566mClient. disconnect();
6667// or
6768ref. dispose();
6869```
6970
7071### sendData
71- ```
72+ ``` java
7273mClient. sendData(bytes);
7374// or
7475mClient. sendData(string);
You can’t perform that action at this time.
0 commit comments