1 Star 0 Fork 100

codingrun / socket.d

forked from noear / socket.d 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
README.md 5.97 KB
Copy Edit Raw Blame History
西东 authored 2023-12-16 13:36 . README

Network application protocol based on event and semantic message streams

https://socketd.noear.org

Maven Apache 2 jdk-8 jdk-11 jdk-17 jdk-21
gitee star github 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
Java
1
https://gitee.com/vibrantbyte/socket.d.git
git@gitee.com:vibrantbyte/socket.d.git
vibrantbyte
socket.d
socket.d
main

Search