How Do Sockets Work in C?

前端 未结 4 923
渐次进展
渐次进展 2021-02-04 02:02

I am a bit confused about socket programming in C.

You create a socket, bind it to an interface and an IP address and get it to listen. I found a couple of web resources

4条回答
  •  执念已碎
    2021-02-04 02:17

    Sockets operate at a higher level than raw packets - it's like a file you can read/write from. Also, when you try to read from a socket, the operating system will block (put on hold) your process until it has data to fulfill the request.

提交回复
热议问题