ࡱ;   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entry  .)䰱draw_StarDraw_50 StarDraw 5.0CeQSfxDocumentInfo  @2kloder @2| @2Navigating File Systems Info 1 Info 2 Info 3 Info 4 @20<44Standard LIBIMBEDDED LIBIMBEDDED1,,,1SBX sb : Standard StarBASICSBX ARSBX AR SBX ARSBX OBc BasicLibrariesBasicLibrariesSBX ARSBX AR SBX ARSBX OBe DialogLibrariesDialogLibrariesSBX ARSBX AR SBX AR2c%bqqOh+'0  h p | 6@I@y@*NkloderNavigating File SystemsXOutdevItemPool 1   )     &'()*+,-./06789:;UVWXYZ[\]c !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstt      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefd0$A'@q OXX',@X':@2 XXXX&' @ X'c@Arrow  XX'c@Arrow  XX'.@/,XXX'"@a,XX'@XX'@X'@CXX'b@8̙XXX X2XD'6@22ddX'(@X'@BM66( SDx^ѕ0 tŨ'Ց6~|m1ټ^[9x?'oy^` BKy yC- )O>Z򒗓|ky[ނ^#GsޖZiɗb<XFXNXVX^XfXnXvX~XKK@ BXXMM.@ =}XXXNN.@ =XXXOO"@2 =XXPP"@` =XXQQ@ +%XXSS@ AXUU@ AXVV(@ $XXX @ ''''' ''''''''XXX X,XDXPXhXtXz@Y '''' '''''''''XXX&X8XJX\XnXz**<@  XXXX X&77z@++;(,,+;(,, +;(+;( +;(XXX&X8XDXPX\HH @ *<(@'*<(@' +'*<(@'**<(@'XXX2XPX\XzXXXff@ JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV QQVVIIQQVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKK  JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJ  JJ KKMMNNOOPPQQSSUUVV JJ KKMMNNOOPPQQSSUUVV JJ KKMMNNOOPPQQSSUUVV JJ KKMMNNOOPPQQSSUUVV JJ KKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVV JJKKMMNNOOPPQQSSUUVVXXXVXXXXXFXXXXX`XlXXX2XtXXX:X|8pQ(PoI} 7Y/W'Qs 8  P&YEditEngineItemPool 6fyR0-g*@BX*@7 XX*@_ XX* @}g*{<@RZ" 9Times New Roman--dZ "X2StarBatsN-"2StarBatsN-"2StarBatsN-"` ` 2StarBatsN-" 2StarBatsN-"2StarBatsN-"hh2StarBatsN-"2StarBatsN-"2StarBatsN-"pp2StarBatsN- "2StarBatsN-"2StarBatsN-"2StarBatsN-"` ` 2StarBatsN-" 2StarBatsN-"2StarBatsN-"hh2StarBatsN-"2StarBatsN-"2StarBatsN-"pp2StarBatsN- Z" 9Times New Roman33d 9Times New Romanffd" 9Times New Romand 9Times New Romand9Times New Romand9Times New Romand9Times New Romand9Times New Romand9Times New RomandZ ZS9Times New Romand" L9Times New Roman33d 9Times New Romanffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ Z" 9Times New Romand 9Times New Romand" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZZ" /Arial--dZ Z" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33d" 9Times New Roman33dZ# ZS9Times New Romand" L/Arial33d 9Times New Romanffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ  ZS9Times New Romand" L9Times New Roman33d" /Arialffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ  ZS9Times New Romand" L9Times New Roman33d 9Times New Romanffd" g /Ariald ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ  ZS9Times New Romand" L5 Courier New33d 9Times New Romanffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ  ZS9Times New Romand" L9Times New Roman33d" 5 Courier Newffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ  ZS9Times New Romand" L5 Courier Newd 9Times New Romanffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZ ZS9Times New Romand" c9Times New Roman33d 9Times New Romanffd" g 9Times New Romand ]9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandS9Times New RomandZXXXX] X X.XX]XX X/%X)Xe.X3X7 @S@XD (@MX StarSymbol!---Times New Roman!d Times New Roman{!dTimes New Roman!dT33Times New Roman!d--Arial!dffArial!d33Arial!dArial{!d ffTimes New Roman!d 33 Courier New!d ff Courier New!d  Courier New!d 33Times New Roman!dXXIXXX XIXXXX!XaXXX@'"@YCdddddXddddddd ddd g dddg ]ddd]SdddSddLddddYL ddd Yg dddg Y]ddd]YSdddSY!dddYcXX!X4XGXZXmXXXXXXXXX6A'@ Zdddddddd^dd dd dd dd dd ddddddXXX&X2X>XJXVXbXnXzX1' @ x[ VNa.Wddbd\ Q M E @XXX$X/X:XEXPX[XfXqX|X+'(@[ XXX'@_. . . . . . . ". '. ,. 1. 6. ;. ~@. tE. jJ. `O. VT. LY. B^. 8c. . A. 7. - . #. . . . #. (. -. 2. 7. <. A. F. K. P. U. Z. _. . . . . . . . . $. ). .. |3. r8. h=. ^B. TG. JL. @Q. 6V. ,[. "`. . {. q. g . ]. S. I. ? . 5%. +*. !/. 4. 9. >. B. G. L. Q. V. [. `. . {. q. g . ]. S. I. ? . 5%. +*. !/. 4. 9. >. B. G. L. Q. V. [. . /. . . #. -. 7. A. K. U. {_. gi. oi. en. . . . . . ). s3. _=. KG. 7Q. #[. e. e. j. XXX>XXnXXf!' @ [`33--ff 3333 ff ̙XXX&X2X>XJXVXbXnXz'V@` Times New Romanw Courier NewArialXX(X>'@aNd 4d d d {d d d d id 5Od :d d  d %Xd  rd XXX"X,X6X@XJXTX^XhXrX|XXX* @a'@b XX'@&b X'@Eb X'@ib XX'@bX'@b X%'@b dXS' @b"' @b' @c$'@4cH  XX*@Xc X* @rc*@dHG Mincho Light J;MS Gothic;HG Gothic J;HG Gothic B;HG Gothic;Gothic;MS PGothic;Andale Sans UI;Arial Unicode MS;Lucida Sans Unicode;TahomaTimes New Roman HG Mincho Light J;MS Gothic;HG 宋体굴림XXXXX*@Le.Tahoma;Lucidasans;Lucida Sans;Arial Unicode MSTimes New Roman HG Mincho Light J;MS Gothic;HG 宋体굴림XXGXaXX*@ ed id 5Od :d d d d %Xd {d rd XXX"X,X6X@XJXTX^Xh*@ |fd id 5Od :d d d d %Xd {d rd XXX"X,X6X@XJXTX^Xh*@fX*@fX*@fX*@gX*@?B/DDEEIJJKK"LAL`LLLLLLM)MSMsMMNwOPPPPQ7QWQwQQQP mg* "2StarBatsN-"2StarBatsN-"2StarBatsN-"` ` 2StarBatsN-" 2StarBatsN-"2StarBatsN-"hh2StarBatsN-"2StarBatsN-"2StarBatsN-"pp2StarBatsN- ( StarSymbol!-!''Nimbus Roman No9 L'Od $' *** Nimbus Sans L*.Tahoma;Lucidasans;Lucida Sans;Arial Unicode MS*Od *Od ltWcL2> +DefaultDefault2'''''''''''''''+;(,,--..***g* (@'A'1'+''!''' ''''''%'**********Object with arrowDefaultObject with arrow'''''''Object with shadowDefaultObject with shadow+;(,,--..Object without fillDefaultObject without fill'TextDefaultText'' Text bodyDefault Text body'''Text body justfiedDefaultText body justfied''+'First line indentDefaultFirst line indent''g*@'TitleDefaultTitle'''Title1DefaultTitle1 '''+;(,,--..+''Title2DefaultTitle2 ''+;(,,--..g*@'A'+''HeadingDefaultHeading''A''Heading1DefaultHeading1''A'''Heading2DefaultHeading2''A''''Dimension LineDefaultDimension Line'''''''Default~LT~Gliederung 1Default~LT~Gliederung 1 ''***g*@'A'1'+''!''' ''''''%'**********Default~LT~Gliederung 2Default~LT~Gliederung 1Default~LT~Gliederung 2***@'A' 1'+''!''' '''''%'*****Default~LT~Gliederung 3Default~LT~Gliederung 2Default~LT~Gliederung 3***@'A' 1'+''!''' '''''%'*****Default~LT~Gliederung 4Default~LT~Gliederung 3Default~LT~Gliederung 4***@'A' 1'+''!''''''''%'*****Default~LT~Gliederung 5Default~LT~Gliederung 4Default~LT~Gliederung 5***@'A' 1'+''!''''''''%'*****Default~LT~Gliederung 6Default~LT~Gliederung 5Default~LT~Gliederung 6***@'A' 1'+''!''''''''%'*****Default~LT~Gliederung 7Default~LT~Gliederung 6Default~LT~Gliederung 7***@'A' 1'+''!''''''''%'*****Default~LT~Gliederung 8Default~LT~Gliederung 7Default~LT~Gliederung 8***@'A' 1'+''!''''''''%'*****Default~LT~Gliederung 9Default~LT~Gliederung 8Default~LT~Gliederung 9***@'A' 1'+''!''''''''%'*****Default~LT~TitelDefault~LT~Titel!''QQ***g*@'A'1'+''!''' ''''''%'**********Default~LT~UntertitelDefault~LT~Untertitel!''QQ***g*@'A'1'+''!''' ''''''%'**********Default~LT~NotizenDefault~LT~Notizen ''***g*@'A' 1'+''!'''''''''%'*** * ******Default~LT~HintergrundobjekteDefault~LT~Hintergrundobjekte+;(,,--..Default~LT~HintergrundDefault~LT~Hintergrund'''+;(QQVV+'TitleTitle@SubtitleSubtitle@Background objectsBackground objects@ Background Background@NotesNotes@ Outline 1 Outline 1@ Outline 2 Outline 1 Outline 2@ Outline 3 Outline 2 Outline 3@ Outline 4 Outline 3 Outline 4@ Outline 5 Outline 4 Outline 5@ Outline 6 Outline 5 Outline 6@ Outline 7 Outline 6 Outline 7@ Outline 8 Outline 7 Outline 8@ Outline 9 Outline 8 Outline 9@`&q<10 q X ? &$,("J1d0cDrMdJoeMp0@2@2D6@2 ODrLy LAYER_LAYOUTDrLy LAYER_BCKGRNDDrLy LAYER_BACKGRNDOBJDrLyLAYER_CONTROLSDrLy!LAYER_MEASURELINESDrMP'JoeMjJ8cDrML DrOb<SVDr&qz! %DrOb<SVDr&(B %DrOb<SVDr&q+>z!QDrOb<SVDr&(+>BQDrXXgg iDefault~LT~GliederungDrMP3JoeM8cjJDrML DrObSVDr&8cjJ*Default~LT~Hintergrund8cjJDrObSVDr&q[$Default~LT~Titelq[}xV4B1hZ#Click to edit the title text formatDefault~LT~Titel<( (@'DrObSVDr&q][MA+Default~LT~Gliederung 1q][MA xV4B1Z %Click to edit the outline text formatDefault~LT~Gliederung 1<( (@'Second Outline LevelDefault~LT~Gliederung 2 <( (@'Third Outline LevelDefault~LT~Gliederung 3 <( (@'Fourth Outline LevelDefault~LT~Gliederung 4<( (@'Fifth Outline LevelDefault~LT~Gliederung 5<( (@'Sixth Outline LevelDefault~LT~Gliederung 6<( (@'Seventh Outline LevelDefault~LT~Gliederung 7<( (@'Eighth Outline LevelDefault~LT~Gliederung 8<( (@'Ninth Outline LevelDefault~LT~Gliederung 9<(  (@' DrXXDefaultgg aDefault~LT~GliederungDrMPJoeMjJ8cDrML DrObtSVDr&jJ8cDefaultjJ8cDrObtSVDr&jJ8cDefaultjJ8cDrObSVDr&Z d>,$Default~LT~Titelg q>,qxV4B1\ZClick to move the slideDefault~LT~Titel<( (@'DrObSVDr&q!/B[&Default~LT~Notizenq!/B[zxV4B1eZClick to edit the notes formatDefault~LT~Notizen<( (@'DrXXDefaultgg YDefault~LT~GliederungDrPgcJoeMjJ8cDrML8DrMD,DrXXgg IDefault~LT~GliederungDrPg.JoeM8cjJDrML8DrMD,DrObSVDr&q[+*$Default~LT~Titelq[+*xxV4B1cZMore network programmingDefault~LT~Titel<( (@'DrObSVDr&'"Rw9+Default~LT~Gliederung 1q'"Rw9RxV4B17ZCS 241 Discussion Section Default~LT~Gliederung 1<( (@'A' 1'+' Week 12Default~LT~Gliederung 1<( (@'A' 1'+' 4/23/07 4/29/07Default~LT~Gliederung 1<( (@'A' 1'+' Stephen KloderDefault~LT~Gliederung 1<( (@'A' 1'+' DrXX0More network programminggg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&k q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPgZJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[oxV4B1ZZOutlineDefault~LT~Titel<( (@'DrOb SVDr&q][MA+ Default~LT~Gliederung 1q][MAxV4B1lZDNSDefault~LT~Gliederung 1g*<( (@'A'TCPDefault~LT~Gliederung 1g*<( (@'A'UDPDefault~LT~Gliederung 1g*<( (@'A'HTTPDefault~LT~Gliederung 1g*<( (@'A'DrXXOutlinegg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPg}JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[kxV4B1VZDNSDefault~LT~Titel<( (@'DrObSVDr&q][MA+ Default~LT~Gliederung 1Eq][MA&xV4B1 ZkThe Domain Name System (DNS) converts between name addresses (e.g. www.gnu.org) and number addresses (e.g. Default~LT~Gliederung 1<( (@'A'k199.232.41.10)Default~LT~Gliederung 1<( (@'A'Default~LT~Gliederung 1<( (@'A'KIP uses the numbers for routing messages, but names are easier to remember.Default~LT~Gliederung 1<( (@'A'KDrXXDNSgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1pZDNS example: nslookupDefault~LT~Titel<( (@' DrObSVDr&q][NB+ Default~LT~Gliederung 13q][NB xV4B1Z 'Use nslookup to use DNS from the shell.Default~LT~Gliederung 1<( (@'A''Default~LT~Gliederung 1<( (@'A'"% nslookup csil-core21.cs.uiuc.eduDefault~LT~Gliederung 1<( (@'A'1' " """" " "Server: 128.174.252.4Default~LT~Gliederung 1<( (@'A'1'  Address: 128.174.252.4#53Default~LT~Gliederung 1<( (@'A'1'      Default~LT~Gliederung 1<( (@'A'1' Name: csil-core21.cs.uiuc.eduDefault~LT~Gliederung 1<( (@'A'1' Address: 128.174.242.111Default~LT~Gliederung 1<( (@'A'1'    Default~LT~Gliederung 1<( (@'A'1' DrXX-DNS example: nslookupgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPg?JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1uZDNS example: gethostbynameDefault~LT~Titel<( (@' DrObSVDr&"]_!G+ Default~LT~Gliederung 1p"]_!GQ xV4B1,Z 4To use DNS inside your programs, call gethostbyname.Default~LT~Gliederung 1<( (@'A'1' 4444&3Default~LT~Gliederung 1<( (@'A'1' 0struct hostent *gethostbyname(const char *name);Default~LT~Gliederung 1<( (@'A'1'000000Default~LT~Gliederung 1<( (@'A'1'QSimilarly, use gethostbyaddress to get DNS information about a numerical address.Default~LT~Gliederung 1<( (@'A'1' QQQQDefault~LT~Gliederung 1<( (@'A'1' Istruct hostent *gethostbyaddr(const void *addr, socklen_t len, int type);Default~LT~Gliederung 1<( (@'A'1'IIIIIIDefault~LT~Gliederung 1<( (@'A'1'Default~LT~Gliederung 1<( (@'A'1'DrXX2DNS example: gethostbynamegg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>, DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPg JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1uZgethostbyname contdDefault~LT~Titel<( (@'1' DrObSVDr&q][C+ Default~LT~Gliederung 1=q][CxV4B1Z"To use an address for socket code,Default~LT~Gliederung 1<( (@'A'"Default~LT~Gliederung 1<( (@'A'#include Default~LT~Gliederung 1<( (@'A'1'  Default~LT~Gliederung 1<( (@'A'1'  struct hostent *h;Default~LT~Gliederung 1<( (@'A'1'  h = gethostbyname(host);Default~LT~Gliederung 1<( (@'A'1'  =memcpy((char *) &sa.sin_addr.s_addr, h->h_addr, h->h_length);Default~LT~Gliederung 1<( (@'A'1'=== = =Default~LT~Gliederung 1<( (@'A'1'  DrXX.gethostbyname cont’dgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>, DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1ZTransport-level protocolsDefault~LT~Titelg*<( (@'1'DrObSVDr&q][G+Default~LT~Gliederung 1,q][G xV4B1ZmThere are two major protocols for sending data over the internet, that work on top of Internet Protocol (IP).Default~LT~Gliederung 1g*<( (@'A'1' mmmmm#Transmission Control Protocol (TCP)Default~LT~Gliederung 2g*  <( (@'A' 1' #####"Sends data as a stream of bytesDefault~LT~Gliederung 3g*  <( (@'A' 1'User Datagram Protocol (UDP)Default~LT~Gliederung 2g*  <( (@'A' 1' Sends data as a set of packetsDefault~LT~Gliederung 3g*  <( (@'A' 1'LSockets code chooses its protocol through the type value in the socket call.Default~LT~Gliederung 1g*<( (@'A'1' LLLLL.2@F%SOCK_STREAM is TCP, SOCK_DGRAM is UDPDefault~LT~Gliederung 2g*  <( (@'A' 1'  %%%%%DrXX1Transport-level protocolsgg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&k q>, DrObSVDr&d/C[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPg(JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[kxV4B1VZTCPDefault~LT~Titel<( (@'DrObSVDr&q][MA+ Default~LT~Gliederung 1xq][MAYxV4B1<ZuTCP is stream-based. It takes a stream of data, breaks it up into packets, and sends the packets to the destination.Default~LT~Gliederung 1<( (@'A' uuuuDefault~LT~Gliederung 1<( (@'A' VBoth sender and receiver perform routines to make sure every packet arrives, in order.Default~LT~Gliederung 1<( (@'A' VVVVDefault~LT~Gliederung 1<( (@'A' ]Calling send with TCP does not send data, but writes to the stream, which will be sent later.Default~LT~Gliederung 1<( (@'A' ]]]] DrXXTCPgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[kxV4B1VZUDPDefault~LT~Titel<( (@'DrObISVDr&q][MA+ Default~LT~Gliederung 1q][MAxV4B1ZVUDP is packet-based. Every call to send sends a packet containing the inputted data.Default~LT~Gliederung 1<( (@'A'V$(Default~LT~Gliederung 1<( (@'A'TUDP contains no provisions for flow control, session management, or packet ordering.Default~LT~Gliederung 1<( (@'A'TDrXXUDPgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPg s JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1ZTCP vs. UDP at a glanceDefault~LT~Titelg*<( (@'1'DrOb SVDr&sabG+Default~LT~Gliederung 1 sabGt xV4B1G Z TCPUDPDefault~LT~Gliederung 1 g*<( (@'A' 1''       Default~LT~Gliederung 1g*<( (@'A' 1'  %Socket typeSOCK_STREAMSOCK_DGRAMDefault~LT~Gliederung 1 g*<( (@'A' 1'' %%%% % %   %Default~LT~Gliederung 1g*<( (@'A' 1'  *Form of data transmittedStreamPacketsDefault~LT~Gliederung 1 g*<( (@'A' 1'' **** * * !!""#Default~LT~Gliederung 1g*<( (@'A' 1'  =Calls for sending and receivingsend, recvsendto, recvfromDefault~LT~Gliederung 1 g*<( (@'A' 1'' ==== = =  !!++,,--=Default~LT~Gliederung 1g*<( (@'A' 1'  Uses sessions?YesNoDefault~LT~Gliederung 1 g*<( (@'A' 1''   Default~LT~Gliederung 1g*<( (@'A' 1'  3Overhead for ordering packetsSubstantialMinimalDefault~LT~Gliederung 1 g*<( (@'A' 1'' 3333 3 3*++,Default~LT~Gliederung 1g*<( (@'A' 1'  'Example ServicesFTP, HTTPDNS, SNMPDefault~LT~Gliederung 1 g*<( (@'A' 1'' '''' ' 'DrXX/TCP vs. UDP at a glancegg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&k q>,DrObSVDr&d/C[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPgKJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1ZExample 1: simple chatDefault~LT~Titelg*<( (@'1'DrOb6SVDr&s[bG+Default~LT~Gliederung 1s[bGxV4B1ZjThis is a program to allow two users to send messages back and forth, on the same host or different hosts.Default~LT~Gliederung 1g*<( (@'A'1'j jjjjjDefault~LT~Gliederung 1g*<( (@'A'1'  IThis program uses a client (chat-client1.c) and a server (chat-server.c).Default~LT~Gliederung 1g*<( (@'A'1'  IIIII**::GGIDefault~LT~Gliederung 1g*<( (@'A'1'  *Fill in the skeleton code, which uses TCP.Default~LT~Gliederung 1g*<( (@'A'1' * *****DrXX.Example 1: simple chatgg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&k q>,DrObSVDr&d/C[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPg(JoeM8cjJDrML8DrMD,DrObSVDr&q[$Default~LT~Titelq[xxV4B1cZExample 2: Chat with UDPDefault~LT~Titel<( (@'DrObSVDr&q][C+Default~LT~Gliederung 1kq][CL xV4B1'Z Convert chat-client1.c and Default~LT~Gliederung 1<( ( @'A'1' #chat-server1.c into chat-client2.c Default~LT~Gliederung 1<( ( @'A'1' ######"*and chat-server2.c, which use UDP instead Default~LT~Gliederung 1<( ( @'A'1' ******of TCP.Default~LT~Gliederung 1<( ( @'A'1' Default~LT~Gliederung 1g*<( ( @'A'1' !SOCK_DGRAM instead of SOCK_STREAMDefault~LT~Gliederung 2g* <( ( @'A' 1' !!No accept, listen, or connectDefault~LT~Gliederung 2g* <( ( @'A' 1'  sendto instead of sendDefault~LT~Gliederung 2g* <( ( @'A' 1'recvfrom instead of recvDefault~LT~Gliederung 2g* <( ( @'A' 1'DrXX0Example 2: Chat with UDPgg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPgXJoeM8cjJDrML8DrMD,DrOb SVDr&q[$ Default~LT~Titelq[xV4B1xZsend and sendtoDefault~LT~Titel<( (@'1' DrObWSVDr&q][MA+ Default~LT~Gliederung 1q][MAxV4B1Z:int send(int socket, const void *msg, int len, int flags);Default~LT~Gliederung 1<( (@'A'1'  ::::::: : :Default~LT~Gliederung 1<( (@'A'1'    hint sendto(int socket, const void *msg, int len, int flags, const struct sockaddr *to, socklen_t tolen);Default~LT~Gliederung 1<( (@'A'1'  <hhhhhh h h<f fhDefault~LT~Gliederung 1<( (@'A'  Ysend sends along an established connection (TCP), while sendto sends to an address (UDP).Default~LT~Gliederung 1<( (@'A'1' YYYY8>Default~LT~Gliederung 1<( (@'A' 1The extra two parameters specify the destination.Default~LT~Gliederung 1<( (@'A' 1111DrXX'send and sendtogg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgJoeM8cjJDrML8DrMD,DrOb SVDr&q[$ Default~LT~Titelq[xV4B1zZrecv and recvfromDefault~LT~Titel<( (@'1' DrObSVDr&q][MA+ Default~LT~Gliederung 1$q][MAxV4B1Z:int recv(int socket, const void *msg, int len, int flags);Default~LT~Gliederung 1<( (@'A'1'  ::::::: : :Default~LT~Gliederung 1<( (@'A'1'    oint recvfrom(int socket, const void *msg, int len, int flags, const struct sockaddr *from, socklen_t *fromlen);Default~LT~Gliederung 1<( (@'A'1'  >oooooo o o>m moDefault~LT~Gliederung 1<( (@'A'1'  wrecv receives from an established connection (TCP), while recvfrom receives from anywhere (UDP), and saves the address.Default~LT~Gliederung 1<( (@'A'1' wwww:BDefault~LT~Gliederung 1<( (@'A'1' ,The extra two parameters specify the source.Default~LT~Gliederung 1<( (@'A'1' ,,,,DrXX)recv and recvfromgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPg 5 JoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1ZStream vs. Packets:an exampleDefault~LT~Titelg*<( (@'1'DrObSVDr&q[H+Default~LT~Gliederung 1Nq[H/ xV4B1Z eWith TCP, data can be sent with different breakdown than it is received, For example, we can replaceDefault~LT~Gliederung 1g* <( ( @'A' 1'  eeeeeDefault~LT~Gliederung 1g* <( ( @'A' 1'  send(sock, buffer, size, 0);Default~LT~Gliederung 2g*  <( ( @'A' 1'  Default~LT~Gliederung 1g* <( ( @'A' 1'  withDefault~LT~Gliederung 1g* <( ( @'A' 1'  Default~LT~Gliederung 2g*  <( ( @'A' 1'  for(i=0;i,DrObSVDr&d/C[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPgBJoeM8cjJDrML8DrMD,DrObSVDr&q[$Default~LT~Titelq[oxV4B1ZZUDP and packetsDefault~LT~Titel<( (@'DrObSVDr&q][A+Default~LT~Gliederung 1q][AoxV4B1RZ=Since UDP is packet-based, each packet is treated separately.Default~LT~Gliederung 1<( (@'A'Default~LT~Gliederung 1<( (@'A'UTherefore, if you send 100 packets with UDP, the other host will receive 100 packets.Default~LT~Gliederung 1<( (@'A'Default~LT~Gliederung 1<( (@'A'TWith TCP, any number of packets could be sent depending on the state of the network.Default~LT~Gliederung 1<( (@'A'DrXX'UDP and packetsgg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&g q>,DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPgjJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1ZExample 3: Chat with threadsDefault~LT~Titelg*<( (@'1'DrObISVDr&q][@B+Default~LT~Gliederung 1q][@BxV4B1ZDThese chat programs assume alternating send/receive communication. Default~LT~Gliederung 1g* <( ( @'A'1'DDDD D DDefault~LT~Gliederung 1g* <( ( @'A'1'  CThus the output is counterintuitive if the users deviate from this.Default~LT~Gliederung 1g* <( ( @'A'1'CCCC C CDefault~LT~Gliederung 1g* <( ( @'A'1'  ]Therefore, chat-client3.c and chat-server.c use threads to send and receive at the same time.Default~LT~Gliederung 1g* <( ( @'A'1']]]] ] ] +Default~LT~Gliederung 1g* <( ( @'A'1'  Fill in the skeletons.Default~LT~Gliederung 1g* <( ( @'A'1'  DrXX4Example 3: Chat with threadsgg QDefault~LT~GliederungDrPg,JoeMjJ8cDrMLdDrMD,DrMD,DrOb<SVDr&k q>,!DrObSVDr&d/C[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXDrObtSVDr&iJ7cDefaultiJ7cgg QDefault~LT~GliederungDrPg rJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[}xV4B1hZHTTP: Parsing the URLDefault~LT~Titel<( (@'DrObSVDr&q][MA+Default~LT~Gliederung 1q][MAxV4B1tZEach URL has three components:Default~LT~Gliederung 1<( (@'A'Default~LT~Gliederung 1<( (@'A'#http://www.linux.org/info/faq1.htmlDefault~LT~Gliederung 1<( (@'A'+' ##Default~LT~Gliederung 1<( (@'A' Protocol Host PathDefault~LT~Gliederung 1<( (@'A''    DrXX-HTTP: Parsing the URLgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,#DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1jZHTTP: Forming a requestDefault~LT~Titel<( (@'DrObSVDr&q][MA+ Default~LT~Gliederung 1Jq][MA+xV4B1ZbThe HTTP client connects to the host, and sends a request in the protocol which contains the path.Default~LT~Gliederung 1<( (@'A'bDefault~LT~Gliederung 1<( (@'A'vIn our example, the client would connect to www.linux.org port 80, and send the request GET /info/faq1.html HTTP/1.0Default~LT~Gliederung 1<( (@'A' v,::>>? ?A]llm mqqvDrXX/HTTP: Forming a requestgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,%DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgFJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[xV4B1oZExample 4: basic HTTP clientDefault~LT~Titel<( (@'DrObASVDr&q[C+Default~LT~Gliederung 1q[CxV4B1Zvweb.c is a skeleton for a program that given a URL, contacts the web server, requests the file, and saves the results.Default~LT~Gliederung 1g*<( ( @'!A'1'vDefault~LT~Gliederung 1g*<( ( @'!A'Fill in the details.Default~LT~Gliederung 1g*<( ( @'!A'DrXX4Example 4: basic HTTP clientgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,'DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgLJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[txV4B1_Z HTTP clientsDefault~LT~Titel<( (@' DrObgSVDr&q][MA+ Default~LT~Gliederung 1q][MAxV4B1Z9HTTP clients (e.g. web browser) do more than the example:Default~LT~Gliederung 1g*<( (@'A'9Error HandlingDefault~LT~Gliederung 2g* <( (@'A'  HTTP fieldsDefault~LT~Gliederung 2g* <( (@'A'  associated imagesDefault~LT~Gliederung 2g* <( (@'A' CGIDefault~LT~Gliederung 2g* <( (@'A' Etc.Default~LT~Gliederung 2g* <( (@'A' Default~LT~Gliederung 1g*<( (@'A'DrXX$ HTTP clientsgg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,)DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrPgjJoeM8cjJDrML8DrMD,DrObSVDr&q[$ Default~LT~Titelq[oxV4B1ZZSummaryDefault~LT~Titel<( (@'DrObSVDr&q][MA+ Default~LT~Gliederung 1*q][MA xV4B1Z&Use DNS to get an address from a name.Default~LT~Gliederung 1g*<( (@'A'&,Use TCP for longer, controlled data streams.Default~LT~Gliederung 1g*<( (@'A',1Use UDP for shorter, packet-based communications.Default~LT~Gliederung 1g*<( (@'A'1HTTP uses TCP.Default~LT~Gliederung 1g*<( (@'A'DrXXSummarygg QDefault~LT~GliederungDrPgJoeMjJ8cDrML8DrMD,DrOb<SVDr&g q>,+DrObSVDr&q!/B[& Default~LT~Notizenq!/B[nxV4B1YZClick to add notesDefault~LT~Notizen<( (@'DrXXgg YDefault~LT~GliederungDrXXNds_csil_0216CUPS:ds_csil_0216VT$mJobData 1 printer=ds_csil_0216 orientation=Portrait copies=1 scale=100 margindajustment=0,0,0,0 colordepth=24 pslevel=0 colordevice=0 PPDContexData DrVwV SVDr SVDr:SVDr{{SVDrA LAYER_LAYOUT:SVDr{{SVDr#SVDr SVDr# SVDr0 SVDr1 SVDr3 SVDr4SVDr@SVDr SVDrD SVDrP SVDrQ DrHL DrHL DrHL CeQ Root Entry.)䰱CompObjFOle persist elements" SfxDocumentInfo uBasicManager2 4StarBASICSfxWindowsStandardJSfxStyleSheetsYSummaryInformation( <StarDrawDocument3$I5