Skip to content
/ socket.d Public

Application protocols based on "event" and "semantic message "" stream" (alternative to http, websocket, etc., in microservices, mobile applications, iot, etc.)

License

Notifications You must be signed in to change notification settings

noear/socket.d

Repository files navigation

Network application protocol based on event and semantic message streams

https://socketd.noear.org

Latest-Version Apache 2.0 Java-8~22 Kotlin-8+ JavaScript-es6+ Python-3.10+
gitee star github star gitcode star


Language: English | 中文

One user said, "Socket.D is to Socket what Vue is to Js and Mvc is to Http."

Main Features

  • Event-based, each message can be event-routed
  • The so-called semantics is described by the meta-information
  • Stream dependency, where related messages are strung together in a stream
  • Language independent, binary transport (tcp, ws, udp) Support multi-language, multi-platform
  • Disconnection reconnection, automatic connection restoration
  • Multiplexing, allowing multiple request and response messages to run simultaneously on a single connection
  • Two-way communication, single link two-way listening and sending
  • Automatic sharding,Data over 16Mb (configurable) will be automatically split and reassembled (except udp)
  • Simple interface, reactive but with callback interface

Simple comparison with other protocols

comparison socket.d http websocket rsocket socket.io
Send (Qos0) Yes No Yes Yes Yes
SendAndRequest (Qos1) Yes Yes No Yes No
SendAndSubscribe (stream) Yes No No Yes No
Reply or respond Yes Yes No Yes No
Single connection two-way communication Yes No Yes(trouble) Yes Yes(trouble)
Data sharding Yes / No Yes Yes
Disconnection automatically reconnect Yes / No Yes Yes
Meta information Yes Yes No Yes No
Event(or path) Yes Yes No No Yes
StreamId (or message correlation) Yes No No Yes No
Broker pattern cluster Yes No No Yes No
Asynchronous Async Sync Async Async Async
Interface experience Classic Classic Classic Reactive(trouble) Classic
Basic transport protocol tcp, udp, ws tcp http tcp, udp, ws ws

Applicable scene

It can be used for MSG, RPC, IM, MQ and other scenarios, and can replace Http, Websocket, gRpc and other protocols. Such as the connection between the mobile device and the server, such as some microservice scenarios, etc.

Simple protocol description( See more here:official website )

  • Connection address style
sd:tcp://19.10.2.3:9812/path?u=noear&t=1234
sd:udp://19.10.2.3:9812/path?u=noear&t=1234
sd:ws://19.10.2.3:1023/path?u=noear&t=1234
  • Frame code structure
//udp only <2k
[len:int][flag:int][sid:str(<64)][\n][event:str(<512)][\n][metaString:str(<4k)][\n][data:byte(<16m)]

Join a community exchange group

QQ communication group:870505482 Wechat Communication group (input: SocketD when applying)

In the communication group, "nanny level" support and help are provided. Technical training and consultancy services are also available if required

Official website

https://socketd.noear.org

Special thanks to JetBrains for supporting the open source project

JetBrains

About

Application protocols based on "event" and "semantic message "" stream" (alternative to http, websocket, etc., in microservices, mobile applications, iot, etc.)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published