資源簡介
1.其他用戶上線通知。
2.其他用戶下線通知。
3.獲取在線列表。
4.用戶之間點對點聊天。
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?“pub.h“
#define ERR_EXIT(m) \
do \
{ \
perror(m); \
exit(EXIT_FAILURE); \
} \
while(0); \
//當前用戶名
char?username[16];
//聊天室成員列表
USER_LIST?client_list;
void?do_someone_login(MESSAGE?&msg);
void?do_someone_logout(MESSAGE?&msg);
void?do_getlist(int?sock);
void?parse_cmd(char?*cmdlineint?sockstruct?sockaddr_in?*servaddr);
bool?sendmsgto(int?sockchar?*namechar?*msg);
void?do_chat(const?MESSAGE?&msg);
void?chat_cli(int?sock);
int?main(void)
{
int?sock;
if?((sock?=?socket(PF_INETSOCK_DGRAM0))?0)
ERR_EXIT(“socket“);
chat_cli(sock);
return?0;
}
void?chat_cli
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-10?19:21??udp_QQ\
?????文件?????????826??2018-04-10?18:42??udp_QQ\pub.h
?????文件???????28088??2018-04-10?19:21??udp_QQ\UDPClick
?????文件????????8996??2018-04-10?19:21??udp_QQ\UDPClick.cpp
?????文件???????27880??2018-04-10?19:00??udp_QQ\UDPServer
?????文件????????6181??2018-04-10?19:02??udp_QQ\UDPServer.cpp
- 上一篇:unity插件之pureMVC
- 下一篇:對抗生成網絡 各種GAN代碼合集
評論
共有 條評論