linux下C++ socket网络编程(26)

cout << \"client connection from: \"

<< inet_ntoa(client_address.sin_addr) << \":\"

<< ntohs(client_address.sin_port) << \" clientfd = \"

<< clientfd << endl;

addfd(epfd clientfd true);

// 服务端用list保存用户连接

clients_list.push_back(clientfd);

cout << \"Add new clientfd = \" << clientfd << \" to epoll\" << endl;

cout << \"Now there are \" << clients_list.size() << \" clients int the chat room\" << endl;

// 服务端发送欢迎信息

cout << \"welcome message\" << endl;

char message[BUF_SIZE

推荐阅读