电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

网络编程技术实验指导书

11页
  • 卖家[上传人]:ni****g
  • 文档编号:470269099
  • 上传时间:2022-12-23
  • 文档格式:DOC
  • 文档大小:171KB
  • / 11 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 1、 网络编程技术实验指导书董黎刚信息与电子工程学院浙江工商大学10/3/2006 2:24:00 PM Content1. Operation of Linux (操作性)11.1 Purpose11.2 Content11.3 Hints22. C Programming Practice(设计性)32.1 Purpose32.2 Content32.3 Grading33. Simple Socket Programming(验证性)43.1 Purpose43.2 Content43.3 Hints44. Concurrency Socket Programming(验证性)54.1 Purpose54.2 Content54.3 Hints55. Windows Socket Programming(验证性)65.1 Purpose65.2 Content65.3 Hints66. Advanced Socket Programming (设计性)76.1 Purpose76.2 Content76.3 Grading8Experiments of Network Program

      2、ming Last updated: 10/3/20061. Operation of Linux (操作性)Name: No.: Class: Grading:1.1 PurposeReview the operation of Linux, in particular shell commands (bash).1.2 ContentEach student is required to finish all of the following tasks. Part I Programming 1) Use “vi” to construct a program “helloworld.c” that can print“hello world”. Compile and run it. (hint: gcc helloworld.c, ./a.out)Part II File/Directory2) Make a new sub-directory in current directory, then move “helloworld.c” into this new sub-d

      3、irectory. (hint: mkdir source, mv old_file new_file)3) Change the access permissions of “helloworld.c” to -rw-r-xrw-. (hint:chmod 656 helloworld.c)4) Find a file named “emacs” in hard disk. (hint: find / -name emacs)5) Make a hard link, which is called “helloworld1.c”, of “helloworld.c”. (hint: ln old_file new_file); 6) Make a symbolic link, which is called “helloworld2.c”, of “helloworld1.c”. Then remove helloworld1.c. (hint: ln s old_file new_file) Check the output of “ls l” to compare the har

      4、d link and soft link.7) Make a copy of “helloworld.c”. The new file is “helloworld3.c”. (hint: cp source_file destination_file) 8) Archive and compress all the files inside a sub-directory. (hint: tar cvf new_file.tar *, gzip old_file)Part III Text9) Show the first 10 line of helloworld.c in reverse order. (hint: head helloworld.c | sort -r)10) Print the number of bytes, words, and lines of helloworld.c to a file called “info.txt”. (hint: wc helloworld.c info.txt)11) Merge helloworld.c and info.

      5、txt to a new file “helloworld.txt”. (hint: paste helloworld.c info.txt helloworld.txt)12) Print column 3-5 of “helloworld.c”. (hint: cut c3-5 helloworld.c)13) Remove “/home/your_name/source”. (hint: rmdir, rm)Part IV Process14) compare the difference among “ps”, “ps f”, and “ps ef”. 15) execute “top” to show the most active processes.Part V I/O Devices 16) Find the free space size in hard disks and usage size of /usr/src. (hint: du, df)Part VI Networking17) Find the IP address of the local host.

      6、 (hint: ifconfig)18) Change the IP address of the localhost. (hint: ifconfig eth0 192.168.2.2 up Or change /etc/sysconfig/network-scripts/ifcfg-eth0)Part VII System Management19) Find the version of Linux kernel and host name in the local host. (hint: uname a)20) Set a regular variable called “var1” and an environment variable “var2”. You can assigned any value. (hint: var1=10, export var2=3, 分别用set, env来查看)21) Find the memory and cpu usage information of this local host. (hint: cat /proc/cpuinf

      7、o, cat /proc/meminfo) 22) Find the .h file containing the definition of struct sockaddr_in in /usr/src/. (hint: grep r “struct sockaddr_in ” /usr/src/* )1.3 Hints1) 先理解命令的含义,再运行试验。如果你想了解是否有完成某项工作的命令,可以使用“apropos 关键词”;如果你想了解某个命令的细节(比如选项),可以使用“man ls”, “ls help” (以ls为例)。如果你想知道某个命令的文件在哪个目录里,可以使用“whereis ls”, “which ls” (以ls为例)。2) 命令执行完,要检查一下是否执行正确,比如用“ls l”检查是否产生了新的文件3)命令执行失败的常见错误有:a) 名字敲错;b) 命令和选项或执行对象之间没有空格;c)文件确实不在你所预想的那个目录里,这可以用“ls l”来检查;d)文件不在缺省路径里,你需要指定文件的路径。4) 用Ctrl-C强行退出正在运行的命令2. C Programm

      8、ing Practice(设计性)Name: No.: Class: Grading:2.1 PurposeReview the knowledge of C programming, in particular operation of structure, pointer, memory, file, etc. It is necessary before learning network programming.2.2 ContentEach student is required to construct a small information management program for managing student records (e.g, No., name, age, scores, hometown) with the following constraint.1) Use a binary file (NOT a text file) to store student records. 2) You can dynamically edit (e.g., ad

      9、d, remove, and show) student records. 3) You must use linked list(链表), pointer(指针), files(文件), structure(结构), dynamic allocation of space(动态分配空间).2.3 GradingContentDetailScore1.Function of programs(30)(1)记录用结构表示,至少包含字符串(如名字)和整型(如年龄)(5)(2)用链表来动态保存记录,并能以命令行或者菜单形式增加(5)、删除(5)和查询(5)内容。如果用数组最多得5分(3)用二进制文件永久保存记录,并能在程序开始运行时读取文件内容(5),在程序运行结束前保存到文件(5)2.Quality of programs(30%)(1)用大括号和缩进来清楚地显示程序结构。(提示:按一次tab键产生一个缩进)(5)(2)各函数有功能说明和参数说明(5)(3)每个源程序文件都有说明(比如本程序功能,作者,包含哪些函数)(5)(4)每个函数长度不超过100行(5)(5)函数、变量取名前后一致并容易理解(5)(6)对不容易理解的常量、

      《网络编程技术实验指导书》由会员ni****g分享,可在线阅读,更多相关《网络编程技术实验指导书》请在金锄头文库上搜索。

      点击阅读更多内容
    最新标签
    监控施工 信息化课堂中的合作学习结业作业七年级语文 发车时刻表 长途客运 入党志愿书填写模板精品 庆祝建党101周年多体裁诗歌朗诵素材汇编10篇唯一微庆祝 智能家居系统本科论文 心得感悟 雁楠中学 20230513224122 2022 公安主题党日 部编版四年级第三单元综合性学习课件 机关事务中心2022年全面依法治区工作总结及来年工作安排 入党积极分子自我推荐 世界水日ppt 关于构建更高水平的全民健身公共服务体系的意见 空气单元分析 哈里德课件 2022年乡村振兴驻村工作计划 空气教材分析 五年级下册科学教材分析 退役军人事务局季度工作总结 集装箱房合同 2021年财务报表 2022年继续教育公需课 2022年公需课 2022年日历每月一张 名词性从句在写作中的应用 局域网技术与局域网组建 施工网格 薪资体系 运维实施方案 硫酸安全技术 柔韧训练 既有居住建筑节能改造技术规程 建筑工地疫情防控 大型工程技术风险 磷酸二氢钾 2022年小学三年级语文下册教学总结例文 少儿美术-小花 2022年环保倡议书模板六篇 2022年监理辞职报告精选 2022年畅想未来记叙文精品 企业信息化建设与管理课程实验指导书范本 草房子读后感-第1篇 小数乘整数教学PPT课件人教版五年级数学上册 2022年教师个人工作计划范本-工作计划 国学小名士经典诵读电视大赛观后感诵读经典传承美德 医疗质量管理制度 2
    关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
    手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
    ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.