91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.04MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2023-11-03
  • 語言: 其他
  • 標簽: 嵌入式??linux??

資源簡介

基于嵌入式linux的網(wǎng)絡(luò)聊天室的實現(xiàn),有詳細的軟件設(shè)計文檔,用戶手冊,及源碼

資源截圖

代碼片段和文件信息

/*?client.c?
?*
?*?data:07-02-07
?*
?*?version:1.3
?*?*/
#include“sec_group.h“

#include“client.h“
#include“client_online_list.h“
#include?“gui.h“
#include?“msg_list.h“
#include?“write_record.h“

#define?port?8001

char?TOWHO[20];

void?thread(int?sock_fd);

void?record_select(void);
/*------------------------------------*/
void?first_print_select(int?fd);
void?client_load_deal(int?sock_fd);

void?client_reg_deal(int?sock_fd);

void?client_command_to(char?*?bufchar?*?name);

void?client_command_quit(int?fd);


void?use_command_to_deal(char?*buf);

/*-----------------------------------------*/
/*?the?first?*//*?1^*/
/*?include?two?function?to?make?a?link?*/
int?main(int?argc?char?*argv[])
{

int?wild_sock_fd;
client_help(argcargv);
memset(TOWHO020);
wild_sock_fd?=??create_connect_server();
deal_connect(wild_sock_fd);
return?0;
}


/*-----------------------------------------*/
/*?the?two?*//*?2^*/
/*?create?the?connet?it?didn‘t?have?another?function*/
int?create_connect_server(void)
{

struct?sockaddr_in?pin;
int?sock_fd;
int?n;

bzero(&pin?sizeof(pin));

pin.sin_family?=?AF_INET;
inet_pton(AF_INET?IP?&pin.sin_addr);
pin.sin_port??=?htons(port);

sock_fd?=?socket(AF_INET?SOCK_STREAM?0);
if(sock_fd?==?-1)
{
perror(“call?to?socket“);
exit(1);
}

n?=?connect(sock_fd?(void?*)&pin?sizeof(pin));
if(n?==?-1)
{
perror(“call?to?connect“);
exit(1);
}

return?sock_fd;

}

void?*thr_gui(void?*arg)
{
gui_main();
}


/*?you?see?the?first?from?the?client?*/
void?first_print_select(int?fd)
{
int?ch;
int?client_select_flag?=?0;

do
{
printf(“\nplease?input?\‘r\‘?to?register?and?input?\‘l\‘?to?load?\n“);
?
ch?=?getchar();
while((getchar())?!=?‘\n‘);

if(ch?==?‘r‘)
{
client_reg_deal(fd);
client_select_flag?=?1;
}
else?if(ch?==?‘l‘)
{
client_load_deal(fd);
client_select_flag?=?1;
}
}while(client_select_flag?!=?1);
}


/*??create?a?pthread?to?deal?the?chat?*/
void?deal_connect(int?sock_fd)
{
int?id;
int?n;
pthread_t?tid;
char?buf[MAXLINE];


first_print_select(sock_fd);


if(?0?!=?pthread_create(&tid?NULL?thr_gui?NULL)?)
{
printf(“can?not?create?gui!\n“);
exit(1);
}
usleep(200);
pthread_create((void?*)&idNULL(void?*)thread(void?*)sock_fd);
while(1)
{


read_from_client(buf);

?client_information_judge_deal(bufsock_fd);
write_to_server(bufsock_fd);
memset(buf0MAXLINE);

}
n?= close(sock_fd);
if(n?==?-1)
{
perror(“call?to?close“);
exit(1);
}
exit(0);
}
/*----------------------------------------------*/
/*?the?third?*//*3^*/

/*??the?pthread?function?circle?to?read?and?the?write?to?client?*/
void?thread(int?sock_fd)
{
int?n;
char?*buf?=?(char?*)malloc(MAXLINE);

while(1)
{
memset(buf0MAXLINE);
n?=?read_from_server(sock_fdbuf);
if(?n?==?-1)
{
perror(“call?to?read“);
exit(1);
}

if((buf[0]?==?‘9‘?&&?buf[1]?==?‘9‘)?||?(buf[0]==?‘8‘?&&?buf[1]?==?‘8‘))
{

plist?new;
new?=(plist)?malloc?(sizeof(str

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????364032??2008-09-09?21:04??embedded?linux?chat?room\網(wǎng)絡(luò)聊天系統(tǒng)用戶手冊.doc

?????文件?????668672??2007-02-09?14:16??embedded?linux?chat?room\網(wǎng)絡(luò)聊天系統(tǒng)詳細設(shè)計文檔.doc

?????文件??????11528??2007-02-12?15:01??embedded?linux?chat?room\聊天室參考設(shè)計.txt

?????文件??????39595??2007-02-09?14:48??embedded?linux?chat?room\聊天室項目程序\client\client

?????文件???????9295??2007-02-09?12:48??embedded?linux?chat?room\聊天室項目程序\client\client.c

?????文件????????665??2007-02-08?14:14??embedded?linux?chat?room\聊天室項目程序\client\client.h

?????文件????????280??2007-02-08?14:10??embedded?linux?chat?room\聊天室項目程序\client\client.h~

?????文件???????2944??2007-02-09?09:15??embedded?linux?chat?room\聊天室項目程序\client\client_help.c

?????文件???????3208??2007-02-09?14:17??embedded?linux?chat?room\聊天室項目程序\client\client_online_list.c

?????文件????????407??2007-02-08?14:24??embedded?linux?chat?room\聊天室項目程序\client\client_online_list.h

?????文件???????4612??2007-02-09?14:48??embedded?linux?chat?room\聊天室項目程序\client\divide_screen.c

?????文件???????4507??2007-02-07?21:05??embedded?linux?chat?room\聊天室項目程序\client\divide_screen.c~

?????文件????????108??2007-02-06?18:23??embedded?linux?chat?room\聊天室項目程序\client\gui.h

?????文件????????235??2007-02-09?09:15??embedded?linux?chat?room\聊天室項目程序\client\makefile

?????文件???????1034??2007-02-08?21:58??embedded?linux?chat?room\聊天室項目程序\client\msg_list.c

?????文件????????270??2007-02-08?21:56??embedded?linux?chat?room\聊天室項目程序\client\msg_list.h

?????文件????????336??2007-02-09?10:36??embedded?linux?chat?room\聊天室項目程序\client\sec_group.h

?????文件????????900??2007-02-09?16:04??embedded?linux?chat?room\聊天室項目程序\client\user_talk_record

?????文件????????512??2007-02-08?21:18??embedded?linux?chat?room\聊天室項目程序\client\write_record.c

?????文件????????109??2007-02-08?21:51??embedded?linux?chat?room\聊天室項目程序\client\write_record.h

?????文件??????39667??2007-02-09?11:32??embedded?linux?chat?room\聊天室項目程序\client1.4

?????文件??????76635??2007-02-09?10:19??embedded?linux?chat?room\聊天室項目程序\document\team2.tar.gz

?????文件??????70043??2007-02-09?10:47??embedded?linux?chat?room\聊天室項目程序\document\team2c.tar.gz

?????文件?????363008??2008-07-14?20:24??embedded?linux?chat?room\聊天室項目程序\document\網(wǎng)絡(luò)聊天系統(tǒng)用戶手冊.doc

?????文件?????668672??2007-02-09?14:16??embedded?linux?chat?room\聊天室項目程序\document\網(wǎng)絡(luò)聊天系統(tǒng)詳細設(shè)計文檔.doc

?????文件?????????50??2007-02-09?11:29??embedded?linux?chat?room\聊天室項目程序\name.txt

?????文件????????221??2007-02-09?09:44??embedded?linux?chat?room\聊天室項目程序\server\makefile

?????文件????????219??2007-02-09?15:56??embedded?linux?chat?room\聊天室項目程序\server\name.txt

?????文件???????4169??2007-02-09?16:19??embedded?linux?chat?room\聊天室項目程序\server\online_struct.c

?????文件????????460??2007-02-09?09:44??embedded?linux?chat?room\聊天室項目程序\server\online_struct.h

............此處省略25個文件信息

評論

共有 條評論