TreeviewCopyright © aleen42 all right reserved, powered by aleen42
- accept the connection of clients
- new socket descriptor is different from the old one
- The old socket descriptor is to listen to the connections of clients.
- The new socket descriptor is to handle communications between the server and the client.
- accept method will be blocked until complete a connection
int accept(int sockfd, struct sockaddr* clientaddr, int* addrlen)
- sockfd: socket描述符
- clientaddr: 客戶端地址
- addrlen: 地址長度
- >0: new socket descriptor
- -1: failure
- errno: wrong code