Skip to content

Support of non-socket file descriptors like those of a /dev/tty... #1989

Discussion options

You must be logged in to vote

So you have a Linux machine running Mongoose as a websocket server and for some reason you connect an 8-bit hardware with a serial port to one of that LInux machine serial ports.
Somehow and for some reason you need to exchange something with the 8-bitter when something happens somewhere.

On every call to mg_mgr_poll(), when the select()/poll() call returns, all outstanding connections are polled and receive an MG_EV_POLL event.
On your websocket connection:

  • When it receives an MG_EV_WS_MSG event and you need to exchange something with the 8-bitter, you write to your serial port.
  • When it receives an MG_EV_POLL event call, you check your serial port for data from the 8-bitter and read fro…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@jesskomput
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants