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 1
1
# RxSocketClient
2
2
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 )
4
4
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
6
6
RxSocketClient,支持Android,Java和Kotlin的响应式Socket APIs封装,基于RxJava2
7
7
8
8
RxJava2 Version: 2.1.1
9
9
10
10
# Usage
11
11
12
12
### init
13
- ```
13
+ ``` java
14
14
SocketClient mClient = RxSocketClient
15
15
.create(new SocketConfig .Builder ()
16
16
.setIp(IP )
@@ -38,8 +38,9 @@ SocketClient mClient = RxSocketClient
38
38
| Tail | Optional | appending bytes at last when sending data, not included heartbeat |
39
39
40
40
### connect
41
- ```
41
+ ``` java
42
42
Disposable ref = mClient. connect()
43
+ ... // anything else what you can do with RxJava
43
44
.observeOn(AndroidSchedulers . mainThread())
44
45
.subscribe(new SocketSubscriber () {
45
46
@Override
@@ -61,14 +62,14 @@ Disposable ref = mClient.connect()
61
62
```
62
63
63
64
### disconnect
64
- ```
65
+ ``` java
65
66
mClient. disconnect();
66
67
// or
67
68
ref. dispose();
68
69
```
69
70
70
71
### sendData
71
- ```
72
+ ``` java
72
73
mClient. sendData(bytes);
73
74
// or
74
75
mClient. sendData(string);
You can’t perform that action at this time.
0 commit comments