How to open and use a socket in C?

前端 未结 8 2077
生来不讨喜
生来不讨喜 2020-12-13 21:19

I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.

8条回答
  •  我在风中等你
    2020-12-13 21:42

    Unless you write a network daemon, most networking in C can be done at a higher level than using directly the sockets, by using appropriate libraries.

    For instance, if you just want to retrieve a file with HTTP, use Neon or libcurl. It will be simpler, it will be at a higher level and you will have gratis SSL, IPv6, etc.

提交回复
热议问题