欢迎来到毕设资料网! | 帮助中心 毕设资料交流与分享平台
毕设资料网
全部分类
  • 毕业设计>
  • 毕业论文>
  • 外文翻译>
  • 课程设计>
  • 实习报告>
  • 相关资料>
  • ImageVerifierCode 换一换
    首页 毕设资料网 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    计算机专业毕业设计外文翻译--Beej 对网络编程的指导

    • 资源ID:129914       资源大小:39.23KB        全文页数:11页
    • 资源格式: DOCX        下载积分:100金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: QQ登录
    下载资源需要100金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

    计算机专业毕业设计外文翻译--Beej 对网络编程的指导

    1、Beejs Guide to Network Programming 作者: Beej source:http:/ 1. What is a socket? You hear talk of sockets all the time, and perhaps you are wondering just what they are exactly. Well, theyre this: a way to speak to other programs using standard Unix file descriptors.What? Okyou may have heard some Uni

    2、x hacker state, Jeez, everything in Unix is a file! What that person may have been talking about is the fact that when Unix programs do any sort of I/O, they do it by reading or writing to a file descriptor. A file descriptor is simply an integer associated with an open file. But (and heres the catc

    3、h), that file can be a network connection, a FIFO, a pipe, a terminal, a real on-the-disk file, or just about anything else. Everything in Unix is a file! So when you want to communicate with another program over the Internet youre goanna do it through a file descriptor, youd better believe it. Wher

    4、e do I get this file descriptor for network communication, Mr. Smarty-Pants? is probably the last question on your mind right now, but Im going to answer it anyway: You make a call to the socket () system routine. It returns the socket descriptor, and you communicate through it using the specialized

    5、 send () and recv () (man send4, man recv5) socket calls. But, hey! you might be exclaiming right about now. If its a file descriptor, why in the name of Neptune cant I just use the normal read () and write () calls to communicate through the socket? The short answer is, You can! The longer answer i

    6、s, You can, but send () and recv () offer much greater control over your data transmission. What next? How about this: there are all kinds of sockets. There are DARPA Internet addresses (Internet Sockets),path names on a local node (Unix Sockets), CCITT X.25 addresses (X.25 Sockets that you can safe

    7、ly ignore), and probably many others depending on which Unix flavor you run. This document deals only with the first: Internet Sockets. 2.1. Two Types of Internet Sockets Whats this? There are two types of Internet sockets? Yes. Well, no. Im lying. There are more, but I didnt want to scare you. Im o

    8、nly going to talk about two types here. Except for this sentence, where Im going to tell you that Raw Sockets are also very powerful and you should look them up. All right, already. What are the two types? One is Stream Sockets; the other is Datagram Sockets, which may hereafter be referred to as SO

    9、CK_STREAM and SOCK_DGRAM, respectively. Datagram sockets are sometimes called connectionless sockets. (Though they can be connect ()d if you really want.) Stream sockets are reliable two-way connected communication streams. If you output two items into the socket in the order 1, 2, they will arrive

    10、in the order 1, 2 at the opposite end. They will also be error free. Any errors you do encounter are figments of your own deranged mind, and are not to be discussed here. What uses stream sockets? Well, you may have heard of the telnetapplication, yes? It uses stream sockets. All the characters you

    11、type need to arrive in the same order you type them, right? Also, web browsers use the HTTP protocol which uses stream sockets to get pages. Indeed, if you telnet to a web site on port 80, and type GET /, itll dump the HTML back at you! How do stream sockets achieve this high level of data transmiss

    12、ion quality? They use a protocol called The Transmission Control Protocol, otherwise known as TCP .TCP makes sure your data arrives sequentially and error-free. You may have heard TCP before as the better half of TCP/IP where IP stands for Internet Protocol IP deals primarily with Internet routing a

    13、nd is not generally responsible for data integrity. Cool. What about Datagram sockets? Why are they called connectionless? What is the deal, here, anyway? Why are they unreliable? Well, here are some facts: if you send a datagram, it may arrive. It may arrive out of order. If it arrives, the data wi

    14、thin the packet will be error-free. Datagram sockets also use IP for routing, but they dont use TCP; they use the User Datagram Protocol, or UDP (see RFC-7688.) Why are they connectionless? Well, basically, its because you dont have to maintain an open connection as you do with stream sockets. You j

    15、ust build a packet, slap an IP header on it with destination information, and send it out. No connection needed. They are generally used for packet-by-packet transfers of information. Sample applications: tftp, bootp, etc. Enough! you may scream. How do these programs even work if datagrams might ge

    16、t lost?! Well, my human friend, each has its own protocol on top of UDP. For example, the tftp protocol says that for each packet that gets sent, the recipient has to send back a packet that says, I got it! (an ACK packet.) If the sender of the original packet gets no reply in, say, five seconds, he

    17、ll re-transmit the packet until he finally gets an ACK. This acknowledgment procedure is very important when implementing SOCK_DGRAM applications. 2.2. Low level Nonsense and Network Theory Since I just mentioned layering of protocols, its time to talk about how networks really work, and to show som

    18、e examples of how SOCK_DGRAM packets are built. Practically, you can probably skip this section. Its good background, however. Hey, kids, its time to learn about Data Encapsulation! This is very very important. Basically, it says this: a packet is born, the packet is wrapped (encapsulated) in a head

    19、er (and rarely footer) by the first protocol (say, the TFTP protocol), then the whole thing (TFTP header included) is encapsulated again by the next protocol (say, UDP), then again by the next (IP), then again by the final protocol on the hardware (physical) layer (say, Ethernet). When another computer receives the packet, the hardware strips the Ethernet header, the kernel strips the IP and UDP headers, the TFTP program strips the TFTP


    注意事项

    本文(计算机专业毕业设计外文翻译--Beej 对网络编程的指导)为本站会员(泛舟)主动上传,毕设资料网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请联系网站客服QQ:540560583,我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们
    本站所有资料均属于原创者所有,仅提供参考和学习交流之用,请勿用做其他用途,转载必究!如有侵犯您的权利请联系本站,一经查实我们会立即删除相关内容!
    copyright@ 2008-2025 毕设资料网所有
    联系QQ:540560583