Linux网络编程课程设计说明书.docx

上传人:PIYPING 文档编号:10610126 上传时间:2021-05-25 格式:DOCX 页数:11 大小:30.31KB
返回 下载 相关 举报
Linux网络编程课程设计说明书.docx_第1页
第1页 / 共11页
Linux网络编程课程设计说明书.docx_第2页
第2页 / 共11页
Linux网络编程课程设计说明书.docx_第3页
第3页 / 共11页
Linux网络编程课程设计说明书.docx_第4页
第4页 / 共11页
Linux网络编程课程设计说明书.docx_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《Linux网络编程课程设计说明书.docx》由会员分享,可在线阅读,更多相关《Linux网络编程课程设计说明书.docx(11页珍藏版)》请在三一文库上搜索。

1、politics and the overall situation, implementation, results. Second, the target. According to provincial and municipal, and Municipal Government of decision deployment, lock established 2 a provincial technology poverty model County, and 4 a provincial technology poverty model Township, and 10 a pro

2、vincial technology poverty model village and 1 a city level technology poverty model district, and 2 a city level technology poverty model Township, and 5 a city level technology poverty model village and the five a a technology precision poverty special action of target task, pour row duration, and

3、 charts combat, set time, and set task, and set measures, and set personnel, and set responsibility, ensure quality completed technology precision poverty task. Third, focused. Should focus on the essential . Financial technology project management account project undertaker according to key node ta

4、sks with regular invoices for funding, funding by the Department of science and technology, the financial sector, and resolutely project funds were diverted and misappropriated by interception,. Third, we must strengthen supervision of technology projects. Department of science and technology to str

5、engthen the project inspection or spot checks, poor implementation of the project to strengthen supervision, to entrust the project undertaker rectification of irregularities. To establish a science and technology projects blacklist system, project implementation quality bad credited to blacklist, p

6、eriodic or permanent cancellation of its application, eligibility for provincial and municipal science and technology projects. Four financial management training to be carried out. City Branch knowledge to active cooperation with the financial sector, not organize project undertaker held technology

7、 project management training, State, provincial and municipal scientific and technological projects related to financial management policies, financial approval standard, medium supervision, budgeting, review of the points system training and other key content, ensuring that legitimate security use

8、of project funds. Thank you very much! For implement implementation Central, and province, and city, and County on grass-roots party work of major decision deployment, solid advance county police organ party work, further strengthened Party Secretary tube party rule party responsibility, according t

9、o Communist xuchang County Organization Department on issued straddling County straight organ party debriefing comments assessment work implementation programme of notification requirements, according to Council party work arrangements, today, organization held county police organ Party Secretary ca

10、ught grass-roots party work debriefing comments will. This is Secretary of the party organization of party responsibilities effective measure, and study and carry out the 18 session of the plenary session of the party spirit, to grasp party building under the new situation rules, advancing party con

11、struction services necessary for public security centres. Just now, 3 units debriefing the party, following my reviews each report for 3 party. Branches of the Department on the bright side: the first is to strengthen the ideological and political work, pay close attention to implementation of the w

12、ork. Department party branch in strict accordance with the request of the Bureau, with three-three special education as the main line, take effective measures, pay close attention to implementation of the ideological and political work, strengthen theLinux网络编程课程设计说明书题目:网络数据计算班级:姓名:指导老师:ideological e

13、ducation of party members and police, improve the ideological and political awareness of civilian police, as a solid foundation for the healthy and smooth development of public security work. Second, strict management, boost team morale. Strictly police thought dynamic analysis on a regular basis, t

14、o grasp the persons state of mind, strict implementation of the performance appraisal system, strengthen the teams day-to-day management; cash rewards and punishment, continue to boost troop morale. Third, strengthen the training of civilian police, and improve police actual combat skills. Serious o

15、rganizations are active in a series of training activities and the learning activities of the College of Henan public security network, so that the majority of the civilian police in the political quality, quality, service quality, improve police skills. Four are from the police preferentially, warm

16、 the hearts unite police. According to the Bureaus Party Committee Requirements, and actively carry out personnel management work done within policy, and help police solve practical difficulties make police work and devotion. Five is to step up publicity and promote integrity. Around the center of p

17、ublic security work, to do publicity, fully demonstrated the public security troops good spirit. Six are in compliance with the party responsible, pays special attention to education and management of the party. Improve and perfect the three lessons, members of democratic appraisal, commendation and

18、 reward systems, enhance the creativity, rallying power and combat capability of the branch. Problems: one is the ideological and political work cannot adapt to the new situation and new task needs, form a single, innovative enough, appeal of lack of education, learning effects of education needs to

19、 be improved, administrative departments should strengthen the grass-roots units of instruction. Second branch of the Organization will be implemented is not good enough, to play a lead role. Police Brigade branch of good practice: first, grasp the system of the party construction implementation, st

20、rengthening branch team cohesion and combat effectiveness. Brigade branch always hold on to the party like grim death, seriously carry out their duties, strictly implement the system of democratic life meeting, developed a branch of learning plan, all equipped with notebooks or experience and organi

21、zation check learning on a regular basis, to ensure that the learning plan and implement and effective. Second, carry out the three-three education. Developed a special educational programme, convened a focused learning forums will be consulted and all levels of party branch, in charge of the Deputy

22、 Director, group leader for the party members and police on the party lecture, deployment of the oath again, visiting Yang Shui Memorial, learning advanced figures such as Yan Zhenchang, micro-party lecture features such as attention and learning activities, problems and measures to remedy. Third, e

23、mphasis on party building work in police work. Brigade branch always will party work throughout Yu 9.3 security, and national civilization city review, and Shang collection Organization Conference security, and focus illegal investigation, and sword, and anti-storm fear, and insurance security, and

24、five a wave times, and camp turned non-bus, and big received ring, the focus work in the, timely carried out has pre-war thought mobilization, and wartime dynamic judge, and post-war recognition award, series work measures, team members always fighting in7目 录一、课程设计任务1二 系统设计1三、系统编码实现1四、总结1 一、课程设计任务完成

25、在如下两个题目中任选一个题目。1、网络数据计算(1)在Linux系统下,使用TCP协议套接字编程;(2)服务器应具有处理多个客户端连接并计算的能力;(3)过程描述客户端:连接服务器后,从键盘输入一连串的整数及字符串,并将这些整数及字符串发送到服务器,并发送结束指令(自定义结束指令),等待服务器返回计算结果,显示结果后退出;服务器:为每个客户连接创建一个进程,处理客户数据,显示每次收到一个整或字符串,收到结束指令后将整数累加,并将累加结果返回客户端,并关闭连接,结束进程。2、linux系统下实现聊天室(1)在Linux系统下,使用TCP协议套接字编程;(2)服务器应具有处理多个客户端连接能力(设

26、定最大连接数,如5个);(3)具有群发和私聊的能力;(4)过程描述客户端:连接服务器后,应能接收服务器发来信息并处理的能力,当收到聊天信息时,显示群发或私聊、信息发送客户及发送的信息,当收到客户加入或退出时,显示客户登录或退出,并更新客户列表;每次可选择群发或私聊,群发时将键盘输入信息发送给服务器,私聊时,选择私聊客户并将输入信息发送给服务器。选择退出时,结束进程或线程,关闭程序。服务器:为每个客户连接创建一个进程或线程,处理客户信息,当有新客户加入或有客户退出时,将客户加入或退出信息发送给每个客户端;当收到某客户的群发信息时,将信息转发给每个客户,当收到客户私聊时将信息转发给私聊客户;客户退

27、出时关闭相应的进程或线程。二 系统设计1、数据结构设计给出客户与服务器之间交互信息格式、各个进程(或线程)之间交互的信息格式、系统中必要的数据结构设计,并给出各个信息表达的意义。MSG结构体: 客户端用来向服务端传送数据struct MSGchar name50;/客户名字char buf100;/传输的数据;SUM 结构体: 服务端向客户端传送累加结果数据struct SUMint n;/累加结果;2、流程设计给出客户端每个进程或线程的处理流程(画流程图)给出服务器的总体流程,以及每个进程或线程的处理流程。客户端流程图:开始SocketConnect输入msg.bufmsg.buf?=”by

28、e”退出循环结束程序send()发送数据while(1)是否Send()发送byerecv接收数据服务端流程图:创建套接字sockfd,并绑定、监听接收客户连接connfd,clientfork()while(1)累加计算msg.buf?=”bye”是否开始pid=0while(1)send发送结果break退出循环continue循环接受pid0recv接收数据三、系统编码实现客户端代码:#include #include #include #include #include #include #include #include #include clientmsg.hint main()i

29、nt port;char ip20;char name20;int sockfd;sockfd=socket(AF_INET,SOCK_STREAM,0);printf(server ip:);scanf(%s,ip);printf(server port:); scanf(%d,&port);printf(set your name:);scanf(%s,name);struct sockaddr_in server;bzero(&server,sizeof(server);server.sin_family=AF_INET;server.sin_port=htons(port);serve

30、r.sin_addr.s_addr=inet_addr(ip);connect(sockfd,(struct sockaddr *)&server,sizeof(server);printf(input number:n);while(1)int recvlen=0;struct MSG remsg;struct MSG msg;strcpy(msg.name,name);scanf(%s,msg.buf);if(strcmp(msg.buf,bye)=0)send(sockfd,&msg,sizeof(msg),0);recvlen=recv(sockfd,&remsg,sizeof(rem

31、sg),0);remsg.bufrecvlen=0;printf(sum is %d%sn,remsg.n,remsg.buf);break;else send(sockfd,&msg,sizeof(msg),0);return 0;服务端代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include clientmsg.hint main()int port;char ip20;int lisfd;i

32、nt connfd;int status;lisfd=socket(AF_INET,SOCK_STREAM,0);printf(input server ip:);scanf(%s,ip);printf(input server port:); scanf(%d,&port);struct sockaddr_in server,client;bzero(&server,sizeof(server);server.sin_family=AF_INET;server.sin_port=htons(port);server.sin_addr.s_addr=inet_addr(ip);int addr

33、len=sizeof(client);bind(lisfd,(struct sockaddr *)&server,sizeof(server);listen(lisfd,5);while(1)connfd=accept(lisfd,(struct sockaddr *)&client,&addrlen);pid_t pid;pid=fork();if(pid=49&msg.buf00)continue;return 0;.H头文件struct MSGint n;char name50;char buf100;struct SUMint n;四、总结 为期一周的Linux网络编程课程设计结束了,在本次课程设计我收获良多,也深深的认识到了自己的不足,很多原来没有弄懂的知识都能明白,但是更多的是还是不会的东西,此次设计的程序能够实现一对多的网络计算服务,但是程序不能很好地识别输入的字符串。还有对fork()函数的使用不能十分理解,没有实现对进程的资源回收,浪费系统资源,程序漏洞很多,不能处理更多的情况,没有通过进程间的通信实现数据传输,这已是我最大的努力结果。最后感谢在我遇到困难时帮助我的老师和同学们,谢谢你们的帮助。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1