SSMP 开源消息传递协议 项目简介
SSMP 是 Stupid-Simple Messaging Protocol,开源消息传递协议。语法:message = ( request | response | event ) LF
request = "LOGIN" SP id SP id [ SP payload ]
| "CLOSE"
| "PING"
| "PONG"
| forwardable
response = code [ SP payload ]
event = "000" SP id SP ( forwardable | "PING" | "PONG" )
forwardable = "SUBSCRIBE" SP id [ SP "PRESENCE" ]
| "UNSUBSCRIBE" SP id
| "UCAST" SP id SP payload
| "MCAST" SP id SP payload
| "BCAST" SP payload
| compat
compat = verb [ SP id ] [ SP payload ]
code = 3DIGIT
verb = 1*UPALPHA
id = 1*ID
payload = 1*PAYLOAD
ID = UPALPHA | LOALPHA | DIGIT
| "." | ":" | "@" | "/" | "_" | "-" | "+" | "=" | "~"
PAYLOAD = <any 8-bit value, except US-ASCII LF>
UPALPHA = <any US-ASCII uppercase letter "A".."Z">
LOALPHA = <any US-ASCII lowercase letter "a".."z">
DIGIT = <any US-ASCII digit "0".."9">
SP = <US-ASCII SP, space (32)>
LF = <US-ASCII LF, linefeed (10)>
request = "LOGIN" SP id SP id [ SP payload ]
| "CLOSE"
| "PING"
| "PONG"
| forwardable
response = code [ SP payload ]
event = "000" SP id SP ( forwardable | "PING" | "PONG" )
forwardable = "SUBSCRIBE" SP id [ SP "PRESENCE" ]
| "UNSUBSCRIBE" SP id
| "UCAST" SP id SP payload
| "MCAST" SP id SP payload
| "BCAST" SP payload
| compat
compat = verb [ SP id ] [ SP payload ]
code = 3DIGIT
verb = 1*UPALPHA
id = 1*ID
payload = 1*PAYLOAD
ID = UPALPHA | LOALPHA | DIGIT
| "." | ":" | "@" | "/" | "_" | "-" | "+" | "=" | "~"
PAYLOAD = <any 8-bit value, except US-ASCII LF>
UPALPHA = <any US-ASCII uppercase letter "A".."Z">
LOALPHA = <any US-ASCII lowercase letter "a".."z">
DIGIT = <any US-ASCII digit "0".."9">
SP = <US-ASCII SP, space (32)>
LF = <US-ASCII LF, linefeed (10)>