API
Server
Initialization
socket() -> bind() -> listen()
Loop
accept() -> read() -> write() -> close()
Client
Initialization
socket() -> connect()
Loop
read() -> write() -> close()
图片来源:Networking-and-Socket-programming-tutorial-in-C
Server
Initialization
socket() -> bind() -> listen()
Loop
accept() -> read() -> write() -> close()
Client
Initialization
socket() -> connect()
Loop
read() -> write() -> close()