linux下C++ socket网络编程(20)
cout << \"ClientID = \" << clientfd
<< \" closed.\\n now there are \"
<< clients_list.size()
<< \" client in the char room\"
<< endl;
// 发送广播消息给所有客户端
else
{
// 判断是否聊天室还有其他客户端
if(clients_list.size() == 1){
// 发送提示消息
memcpy(&msg.contentCAUTIONsizeof(msg.content));
bzero(send_buf BUF_SIZE);
memcpy(send_buf&msgsizeof(msg));
send(clientfd send_buf sizeof(send_buf) 0);
推荐阅读
- Linux|为什么要开发那么多基于Linux的国产系统,直接使用Linux不可以吗?
- 从头学习Linux基础
- 3步教你做个Linux系统,易用性不比Windows差!你学会了吗?
- Linux该如何学习
- Linux在云端是怎么帮助大家工作简单方便的那?
- Linux当前应用的角色-个人环境的使用
- Linux当前应用的角色-企业环境的应用
- 托瓦斯的Linux的发展
- Linux是什么与如何学习
- 国产linux系统有希望了! 韩国也将摆脱微软依赖: 大规模使用linux