Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RT-Thread-packages/nopoll
ASPLes/nopoll - OpenSource WebSocket toolkit for RT-Thread
https://github.com/RT-Thread-packages/nopoll
iot nopoll websocket
Last synced: 15 days ago
JSON representation
ASPLes/nopoll - OpenSource WebSocket toolkit for RT-Thread
- Host: GitHub
- URL: https://github.com/RT-Thread-packages/nopoll
- Owner: RT-Thread-packages
- License: lgpl-2.1
- Created: 2018-01-20T04:03:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-29T13:44:07.000Z (almost 3 years ago)
- Last Synced: 2023-02-27T20:51:52.555Z (almost 2 years ago)
- Topics: iot, nopoll, websocket
- Language: C
- Size: 124 KB
- Stars: 11
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rt-thread - nopoll - A OpenSource WebSocket implementation (RFC 6455) in ansi C. (Packages / IoT)
- awesome-rt-thread - nopoll - A OpenSource WebSocket implementation (RFC 6455) in ansi C. (Packages / IoT)
README
# noPoll
[noPoll](https://github.com/ASPLes/nopoll) is a OpenSource WebSocket implementation (RFC 6455) , written in ansi C , that allows building pure WebSocket solutions or to provide WebSocket support to existing TCP oriented applications.Here is a simple implementation for RT-Thread based on [noPoll](https://github.com/ASPLes/nopoll) , temporarily only support non-encrypted operation.
# Quick Start
There is a websocket client example at `examples/nopoll_client.c`.
Test server host : echo.websocket.org
Test server port : 80Run the example at `MSH` as follows :
```
msh />nopoll_client
web socket connection ready!
sending content..
recv: Hello RT-Thread!
sendcnt = 1
...
...
```# Notes
## 1 Not defined `strdup` functionIf your compiler is not offered `strdup` function , you can implement it yourself as shown below :
```
/* _strdup.c */
#include#ifdef RT_USING_HEAP
char *strdup(const char *s)
{
size_t len = strlen(s) + 1;
char *tmp = (char *)rt_malloc(len);if(!tmp) return NULL;
rt_memcpy(tmp, s, len);
return tmp;
}
#endif
```
## 2 `FD_SETSIZE` too smallPlease config the project as shown below :
The `RT-Thread Component/Device virtual file system/The maximal number of opened files` value need to greater or equal to `RT-Thread Component/Network stack/light weight TCP/IP stack/The number of raw connection` value.# Reference
1 WebSocket Official website : http://websocket.org/
2 noPoll Official website : http://www.aspl.es/nopoll/
3 noPoll GitHub repository : https://github.com/ASPLes/nopoll
4 WebSocket test server : http://websocket.org/echo.html