All Projects → LiangLuDev → RxSocket

LiangLuDev / RxSocket

Licence: other
RxSocket连接

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to RxSocket

BaseIotUtils
🔥🔥串口工具,屏幕适配,通知工具类,多文件断点下载,xls,xlsx操作,文件处理,crash控制,音视频播放,usb设备检测,adb工具等...
Stars: ✭ 44 (+41.94%)
Mutual labels:  socket
alleycat-reactive
A simple Python library to provide an API to implement the Reactive Object Pattern (ROP).
Stars: ✭ 15 (-51.61%)
Mutual labels:  rx
chat-server
💬 [WIP] Simple Chat Server built with React, Node, Express and Socket.io
Stars: ✭ 18 (-41.94%)
Mutual labels:  socket
laravel-redis-chat
Real Time Chat with Laravel, Node.js, Redis and Socket.io
Stars: ✭ 84 (+170.97%)
Mutual labels:  socket
SockNet
The easiest and fastest way to work with sockets in C#
Stars: ✭ 42 (+35.48%)
Mutual labels:  socket
memsocket
An asynchronous in-memory socket-like interface for Rust
Stars: ✭ 34 (+9.68%)
Mutual labels:  socket
Vutils
Vutils or Vic Utilities is an utility library written in Modern C++ and for Modern C++. It helps your programming go easier, faster, and simpler.
Stars: ✭ 16 (-48.39%)
Mutual labels:  socket
node-abstractsocket
Abstract namespace socket support for Node
Stars: ✭ 24 (-22.58%)
Mutual labels:  socket
Symbol
Symbol .net library
Stars: ✭ 14 (-54.84%)
Mutual labels:  socket
fire-im
分布式IM服务,参考https://github.com/crossoverJie/cim 实现
Stars: ✭ 17 (-45.16%)
Mutual labels:  socket
docker-testssl
http://testssl.sh/ in a tiny docker container
Stars: ✭ 19 (-38.71%)
Mutual labels:  socket
KTV
KTV系统,C#前后台,Android客户端。播放器使用迅雷开源APlayer播放引擎。
Stars: ✭ 33 (+6.45%)
Mutual labels:  socket
rxkotlin-jdbc
Fluent RxJava JDBC extension functions for Kotlin
Stars: ✭ 27 (-12.9%)
Mutual labels:  rx
csharp-libs
This repository contains my own C# libraries which I use for different projects
Stars: ✭ 25 (-19.35%)
Mutual labels:  rx
as2-server
A standalone Java AS2 server - see as2-lib for the generic parts
Stars: ✭ 29 (-6.45%)
Mutual labels:  socket
UnityWebSocket
🐳 The Best Unity WebSocket Plugin for All Platforms.
Stars: ✭ 321 (+935.48%)
Mutual labels:  socket
ddos
Simple dos attack utility
Stars: ✭ 36 (+16.13%)
Mutual labels:  socket
socket-chat
This project will help you build a chat app by using the Socket IO library.
Stars: ✭ 36 (+16.13%)
Mutual labels:  socket
TMDbMultiplatform
Step-by-step guide on Kotlin Multiplatform
Stars: ✭ 86 (+177.42%)
Mutual labels:  rx
realgpserver
程序采用Python语言进行编写开发,用来接收GPS原始数据,并进行解析入库Mysql。主要用到SocketServer,log,command,dbhandler,config几个模块。
Stars: ✭ 13 (-58.06%)
Mutual labels:  socket

Socket连接-RxSocket

功能简介

  • 服务器断开、网络错误等各种方式导致连接失败都会自动一直重连上服务器。
  • 心跳反馈,设置一个时间,每隔一个时间向服务器发送数据,保持在线。

使用方式(Android端)

Android端扫码下载体验

RxSocket.png

1.初始化RxSocket

PS.此项目使用Rx2

//初始化
RxSocket rxSocket = RxSocket.getInstance();

2.重连机制连接

/**
* 重连机制的订阅
* 参数1:服务器地址
* 参数2:端口号
*/
rxSocket.reconnection(HOST, PORT)
        .subscribe(s -> Log.d("server response data", s));

3.心跳重连机制连接(不可动态改变心跳数据)

/**
* 心跳、重连机制的订阅
* 参数1:服务器地址
* 参数2:端口号
* 参数3:心跳发送时间
* 参数4:心跳发送信息
*/
rxSocket.reconnectionAndHeartBeat(HOST, PORT, 5, "---Hello---")
        .subscribe(s -> Log.d("server response data", s));

4.心跳重连机制连接(可动态改变心跳数据)

动态改变心跳数据主要针对于,比如电量cpu内存温度等情况需要动态设置心跳数据。

/**
* 心跳、重连机制的订阅(心跳数据动态改变)
* 参数1:服务器地址
* 参数2:端口号
* 参数3:心跳发送时间
*/
rxSocket.reconnectionAndHeartBeat(HOST, PORT, 5)
	.flatMap(aLong -> mRxSocket.send(mEtHeartText.getText().toString()))
        .compose(mRxSocket.<String>heartBeatChange())
        .subscribe(s -> Log.d("server response data", s));

5.发送数据

mSubscribe = rxSocket.send("hello").subscribe()

6.应用退出或者不需要socket取消订阅

//取消订阅
mSubscribe.dispose();

使用方式(服务端)

使用此软件就不用自己写服务器,先模拟自己测试完毕再跟服务器联调。 服务端模拟软件下载(仅支持Windows系统) 按照图片标注设置就行了。测试是否接收到数据能否发送数据就行了。

网络调试助手.png

意见反馈

如果遇到问题或者好的建议,请反馈到:issue、[email protected] 或者[email protected]

如果觉得对你有用的话,赞一下吧!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].