Killertechno
Posts: 177
Joined: Wed Jan 02, 2013 8:28 am

[TCP] Server/client non blocking: missing sys/event.h?

Thu Mar 28, 2019 1:53 pm

Hi guys, I need to write C program for TCP server (TCP to serial bridge RFC 2217).

First step would be creating TCP server; I'm a noob about TCP server programming so I've found online TCP server examples:

https://github.com/mafintosh/echo-serve ... o-server.c

But when compiling it's missing event.h:
tcp-non-blocking-echo-server.c:10:23: fatal error: sys/event.h: No such file or directory
Then I used /usr/lib/event.h, but here missing kqueue function.

Where can I find running example of TCP server? Thanks.

bzt
Posts: 393
Joined: Sat Oct 14, 2017 9:57 pm

Re: [TCP] Server/client non blocking: missing sys/event.h?

Sun Mar 31, 2019 8:34 pm

Hi,

Auch, that's a terrible example with lots of unecessary dependencies. TCP communication is a lot simpler than that, try one of these:
http://my.fit.edu/~vkepuska/ece3551/ADI ... -serv.html (lwip lib)
https://www.binarytides.com/server-clie ... ets-linux/ (plain posix sockets)
https://www.geeksforgeeks.org/tcp-serve ... tion-in-c/ (also very simple and minimal)

Cheers,
bzt

Return to “C/C++”