Closed hannesa2 closed 2 years ago
I mean something like this https://github.com/Theldus/wsServer/blob/master/example/send_receive.html#L38-L65 but only in C
Hi @hannesa2, wsServer, as you can infer from the name, is a websocket server, not a client, so you cannot connect to a server and send messages through this library.
What you can do with this library is run a server in C, and communicate with clients through it. If you want the opposite, this library unfortunately doesn't suits your needs.
Websockets are often used by browsers, etc., as a top-level layer over TCP, which allows you to send and receive data without the use of polling. If you just want to create a server and a client (both in C) without the participation of browsers, you can stick to the normal use of sockets, as this tutorial explains.
There are great examples how to run a server with ease, but unfortunately I'm a bloody C beginner.
How to make a C program with your lib, which only connect to server and send some text ?
But how to connect to server and from where I get this
fd
?