linux下C++ socket网络编程(22)
bzero(send_buf BUF_SIZE);
memcpy(send_buf&msgsizeof(msg));
if( send(*itsend_buf sizeof(send_buf) 0) < 0 ) {
return -1;
//私聊
if(msg.type==1){
bool private_offline=true;
sprintf(format_message SERVER_PRIVATE_MESSAGE clientfd msg.content);
memcpy(msg.contentformat_messageBUF_SIZE);
// 遍历客户端列表依次发送消息 , 需要判断不要给来源客户端发
list<int>::iterator it;
for(it = clients_list.begin(); it != clients_list.end(); ++it) {
推荐阅读
- Linux|为什么要开发那么多基于Linux的国产系统,直接使用Linux不可以吗?
- 从头学习Linux基础
- 3步教你做个Linux系统,易用性不比Windows差!你学会了吗?
- Linux该如何学习
- Linux在云端是怎么帮助大家工作简单方便的那?
- Linux当前应用的角色-个人环境的使用
- Linux当前应用的角色-企业环境的应用
- 托瓦斯的Linux的发展
- Linux是什么与如何学习
- 国产linux系统有希望了! 韩国也将摆脱微软依赖: 大规模使用linux