Skip to content

LastLongerProject/GoodToGo_SocketServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket Server for IOT device

Category

Notice

NOT every Request will get a Response. Server will filter out the duplicate Request.

API Document

PING/PONG

Send

PING

Get

PONG

Send Request to Server

Format

<request_type>_<request_id>_<container_id>

Regex

^(RTN|RLD)_\w{4}_\d{6}$

Example

Return a container #2020

RTN_AB12_002020

Detail

column description length type accept
request_type - 3 string RTN or RLD
request_id You should set an random 4 digit ID for a request to let you track response. 4 string or integer -
container_id You should pad this column to 6 digit. 6 integer -

Get Response from Server

Format

<response_type>_<status_code>_<request_id>

Regex

^(SUC|ERR)_\d{3}_\w{4}$

Example

Request #AB12 success

SUC_001_AB12

Detail

column description length type expect
response_type - 3 string SUC or ERR
status_code Describe response status. Check Status Code section. 3 integer -
request_id The request ID you set. 4 string or integer -

Status Code

Success

  • 001 Success

Error

  • 101 Format of the Request is invalid
  • 102 Encoding of the Request is invalid
  • 201 Can't Find the Container
  • 202 Container's State is Not Ready For that Action
  • 400 API return Fail Result
  • 901 Connection Closed by Server
  • 998 INTERNAL Server Error
  • 999 Unknown Server Error

Links

  • Recommended Socket Server/Client for Testing: SocketTest

To-do List

All done. Well done!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages