udp: socket --> bind --> sendto/recvfrom --> close
tcp(client): socket --> conect() --> send/recv --> close
tcp(server): socket --> bind() --> listen --> accep() --> recv/send --> close
udp: socket --> bind --> sendto/recvfrom --> close
tcp(client): socket --> conect() --> send/recv --> close
tcp(server): socket --> bind() --> listen --> accep() --> recv/send --> close
转载于:https://www.cnblogs.com/sisa/p/10644953.html