30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
You're welcome - there are a few things I would say about writing network services in C, and particularly on unix-like systems:
memory management will be a PITA as soon as you want to do anything complex (there is already a 1024 byte buffer in this example!)
look at the inetd way of doing this - it manages networking and sub programs provide protocol handling via stdio, use the pipes Luke :)
have a go at turning the example into an HTTP/0.9 server (no request headers, just the request line to parse), if you feel brave look at adding handler threads with pthreads... then never expose to the 'net as pretty much all C network code has vulnerabilities, especially mine!
Have fun!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you so much !
I will build my researches around this, thank you for your time !!
You're welcome - there are a few things I would say about writing network services in C, and particularly on unix-like systems:
Have fun!