home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 September / CHIP_CD_1997_09_PL.iso / software / testsoft / labwind / demo.5 / main / bin / tcpsupp.lfp < prev    next >
Unknown  |  1996-08-02  |  16.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 73 fe 01 ba 00 00 00 04 | 00 00 00 00 00 00 3e 40 |s.......|......>@|
|00000010| 00 00 00 0d 00 00 3b 98 | 00 00 02 a8 00 00 00 80 |......;.|........|
|00000020| 00 00 00 01 ff ff ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 01 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 54 43 50 20 | 53 75 70 70 6f 72 74 20 |....TCP |Support |
|00000060| 4c 69 62 72 61 72 79 00 | 00 00 00 00 00 00 00 00 |Library.|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 00 00 00 00 00 0a 03 e8 | 00 0a ff ff 74 63 70 46 |........|....tcpF|
|00000090| 75 6e 63 50 74 72 00 00 | 02 8f 00 00 00 00 54 68 |uncPtr..|......Th|
|000000a0| 69 73 20 6c 69 62 72 61 | 72 79 20 70 72 6f 76 69 |is libra|ry provi|
|000000b0| 64 65 73 20 73 75 70 70 | 6f 72 74 20 74 6f 20 61 |des supp|ort to a|
|000000c0| 20 70 6c 61 74 66 6f 72 | 6d 20 69 6e 64 65 70 65 | platfor|m indepe|
|000000d0| 6e 64 65 6e 74 20 69 6e | 74 65 72 66 61 63 65 20 |ndent in|terface |
|000000e0| 74 6f 20 72 65 6c 69 61 | 62 6c 65 2c 20 62 79 74 |to relia|ble, byt|
|000000f0| 65 20 73 74 72 65 61 6d | 20 6f 72 69 65 6e 74 65 |e stream| oriente|
|00000100| 64 2c 20 6e 65 74 77 6f | 72 6b 20 63 6f 6e 6e 65 |d, netwo|rk conne|
|00000110| 63 74 69 6f 6e 20 63 61 | 70 61 62 69 6c 69 74 69 |ction ca|pabiliti|
|00000120| 65 73 20 6f 66 20 54 43 | 50 2f 49 50 2e 20 55 73 |es of TC|P/IP. Us|
|00000130| 65 72 73 20 63 61 6e 20 | 72 65 67 69 73 74 65 72 |ers can |register|
|00000140| 20 73 65 72 76 65 72 28 | 73 29 2c 20 63 6f 6e 6e | server(|s), conn|
|00000150| 65 63 74 20 63 6c 69 65 | 6e 74 28 73 29 20 74 6f |ect clie|nt(s) to|
|00000160| 20 6b 6e 6f 77 6e 20 73 | 65 72 76 65 72 28 73 29 | known s|erver(s)|
|00000170| 2c 20 61 6e 64 20 73 65 | 6e 64 20 64 61 74 61 20 |, and se|nd data |
|00000180| 62 65 74 77 65 65 6e 20 | 63 6c 69 65 6e 74 28 73 |between |client(s|
|00000190| 29 20 61 6e 64 20 73 65 | 72 76 65 72 28 73 29 2e |) and se|rver(s).|
|000001a0| 20 0a 0a 55 73 65 72 73 | 20 72 75 6e 6e 69 6e 67 | ..Users| running|
|000001b0| 20 4d 53 20 57 69 6e 64 | 6f 77 73 20 6e 65 65 64 | MS Wind|ows need|
|000001c0| 20 57 49 4e 53 4f 43 4b | 2e 44 4c 4c 20 69 6e 20 | WINSOCK|.DLL in |
|000001d0| 6f 72 64 65 72 20 74 6f | 20 75 73 65 20 74 68 69 |order to| use thi|
|000001e0| 73 20 6c 69 62 72 61 72 | 79 2e 20 20 57 49 4e 53 |s librar|y. WINS|
|000001f0| 4f 43 4b 2e 44 4c 4c 20 | 69 73 20 70 72 6f 76 69 |OCK.DLL |is provi|
|00000200| 64 65 64 20 62 79 20 76 | 65 6e 64 6f 72 73 2c 20 |ded by v|endors, |
|00000210| 77 68 6f 20 61 6c 73 6f | 20 73 75 70 70 6c 79 20 |who also| supply |
|00000220| 79 6f 75 20 77 69 74 68 | 20 74 68 65 69 72 20 45 |you with| their E|
|00000230| 74 68 65 72 6e 65 74 20 | 63 61 72 64 73 20 28 6f |thernet |cards (o|
|00000240| 72 20 77 68 69 63 68 65 | 76 65 72 20 6e 65 74 77 |r whiche|ver netw|
|00000250| 6f 72 6b 20 69 6e 74 65 | 72 66 61 63 65 20 63 61 |ork inte|rface ca|
|00000260| 72 64 20 79 6f 75 20 61 | 72 65 20 75 73 69 6e 67 |rd you a|re using|
|00000270| 20 74 6f 20 72 75 6e 20 | 54 43 50 2f 49 50 29 20 | to run |TCP/IP) |
|00000280| 61 6e 64 20 64 72 69 76 | 65 72 73 2e 20 0a 0a 52 |and driv|ers. ..R|
|00000290| 65 6d 61 72 6b 73 3a 0a | 2d 2d 2d 2d 2d 2d 2d 2d |emarks:.|--------|
|000002a0| 0a 50 6c 65 61 73 65 20 | 72 65 66 65 72 20 74 6f |.Please |refer to|
|000002b0| 20 6f 74 68 65 72 20 73 | 6f 75 72 63 65 73 20 66 | other s|ources f|
|000002c0| 6f 72 20 61 6e 20 69 6e | 2d 64 65 70 74 68 20 74 |or an in|-depth t|
|000002d0| 72 65 61 74 6d 65 6e 74 | 20 6f 66 20 53 6f 63 6b |reatment| of Sock|
|000002e0| 65 74 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 2c 20 |et Progr|amming, |
|000002f0| 66 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 55 4e 49 |for exam|ple, UNI|
|00000300| 58 20 4e 45 54 57 4f 52 | 4b 20 50 52 4f 47 52 41 |X NETWOR|K PROGRA|
|00000310| 4d 4d 49 4e 47 20 62 79 | 20 57 2e 20 52 69 63 68 |MMING by| W. Rich|
|00000320| 61 72 64 20 53 74 65 76 | 65 6e 73 00 00 00 00 00 |ard Stev|ens.....|
|00000330| 5a 00 00 00 00 43 6f 6e | 74 61 69 6e 73 20 66 75 |Z....Con|tains fu|
|00000340| 6e 63 74 69 6f 6e 73 20 | 74 68 61 74 20 63 61 6e |nctions |that can|
|00000350| 20 62 65 20 63 61 6c 6c | 65 64 20 62 79 20 79 6f | be call|ed by yo|
|00000360| 75 72 20 70 72 6f 67 72 | 61 6d 20 77 68 65 6e 20 |ur progr|am when |
|00000370| 69 74 20 69 73 20 61 63 | 74 69 6e 67 20 61 73 20 |it is ac|ting as |
|00000380| 61 20 54 43 50 20 73 65 | 72 76 65 72 2e 00 00 00 |a TCP se|rver....|
|00000390| 00 00 5a 00 00 00 00 43 | 6f 6e 74 61 69 6e 73 20 |..Z....C|ontains |
|000003a0| 66 75 6e 63 74 69 6f 6e | 73 20 74 68 61 74 20 63 |function|s that c|
|000003b0| 61 6e 20 62 65 20 63 61 | 6c 6c 65 64 20 62 79 20 |an be ca|lled by |
|000003c0| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 20 77 68 65 |your pro|gram whe|
|000003d0| 6e 20 69 74 20 69 73 20 | 61 63 74 69 6e 67 20 61 |n it is |acting a|
|000003e0| 73 20 61 20 54 43 50 20 | 63 6c 69 65 6e 74 2e 00 |s a TCP |client..|
|000003f0| 00 00 00 02 05 00 00 00 | 00 54 68 69 73 20 66 75 |........|.This fu|
|00000400| 6e 63 74 69 6f 6e 20 72 | 65 67 69 73 74 65 72 73 |nction r|egisters|
|00000410| 20 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 20 61 73 | your pr|ogram as|
|00000420| 20 61 20 54 43 50 20 73 | 65 72 76 65 72 20 66 6f | a TCP s|erver fo|
|00000430| 72 20 74 68 65 20 73 70 | 65 63 69 66 69 65 64 20 |r the sp|ecified |
|00000440| 70 6f 72 74 20 6e 75 6d | 62 65 72 2e 20 20 43 6c |port num|ber. Cl|
|00000450| 69 65 6e 74 73 20 61 74 | 74 65 6d 70 74 69 6e 67 |ients at|tempting|
|00000460| 20 74 6f 20 63 6f 6e 6e | 65 63 74 20 74 6f 20 79 | to conn|ect to y|
|00000470| 6f 75 72 20 70 72 6f 67 | 72 61 6d 20 6d 75 73 74 |our prog|ram must|
|00000480| 20 75 73 65 20 74 68 65 | 20 73 61 6d 65 20 70 6f | use the| same po|
|00000490| 72 74 20 6e 75 6d 62 65 | 72 2e 20 20 54 68 65 72 |rt numbe|r. Ther|
|000004a0| 65 61 66 74 65 72 2c 20 | 61 6c 6c 20 72 65 71 75 |eafter, |all requ|
|000004b0| 65 73 74 73 20 62 79 20 | 74 68 65 20 63 6c 69 65 |ests by |the clie|
|000004c0| 6e 74 20 77 69 6c 6c 20 | 62 65 20 72 6f 75 74 65 |nt will |be route|
|000004d0| 64 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 73 70 |d throug|h the sp|
|000004e0| 65 63 69 66 69 65 64 20 | 73 65 72 76 65 72 20 63 |ecified |server c|
|000004f0| 61 6c 6c 62 61 63 6b 20 | 66 75 6e 63 74 69 6f 6e |allback |function|
|00000500| 2e 20 0a 0a 59 6f 75 20 | 63 61 6e 20 72 65 67 69 |. ..You |can regi|
|00000510| 73 74 65 72 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |ster you|r progra|
|00000520| 6d 20 61 73 20 61 20 54 | 43 50 20 73 65 72 76 65 |m as a T|CP serve|
|00000530| 72 20 6d 75 6c 69 74 70 | 6c 65 20 74 69 6d 65 73 |r mulitp|le times|
|00000540| 20 61 73 20 6c 6f 6e 67 | 20 61 73 20 79 6f 75 20 | as long| as you |
|00000550| 73 70 65 63 69 66 79 20 | 64 69 66 66 65 72 65 6e |specify |differen|
|00000560| 74 20 70 6f 72 74 20 6e | 75 6d 62 65 72 73 2e 0a |t port n|umbers..|
|00000570| 0a 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 72 |.This fu|nction r|
|00000580| 65 74 75 72 6e 73 20 7a | 65 72 6f 20 66 6f 72 20 |eturns z|ero for |
|00000590| 73 75 63 63 65 73 73 20 | 6f 72 20 61 20 6e 65 67 |success |or a neg|
|000005a0| 61 74 69 76 65 20 65 72 | 72 6f 72 20 63 6f 64 65 |ative er|ror code|
|000005b0| 20 66 6f 72 20 66 61 69 | 6c 75 72 65 2e 20 20 53 | for fai|lure. S|
|000005c0| 65 65 20 74 68 65 20 68 | 65 6c 70 20 66 6f 72 20 |ee the h|elp for |
|000005d0| 74 68 65 20 53 74 61 74 | 75 73 20 63 6f 6e 74 72 |the Stat|us contr|
|000005e0| 6f 6c 20 66 6f 72 20 74 | 68 65 20 65 72 72 6f 72 |ol for t|he error|
|000005f0| 20 63 6f 64 65 20 76 61 | 75 65 73 2e 00 00 00 00 | code va|ues.....|
|00000600| 01 8e 00 00 00 00 54 68 | 65 20 70 6f 72 74 20 6e |......Th|e port n|
|00000610| 75 6d 62 65 72 20 75 6e | 64 65 72 20 77 68 69 63 |umber un|der whic|
|00000620| 68 20 79 6f 75 72 20 70 | 72 6f 67 72 61 6d 20 69 |h your p|rogram i|
|00000630| 73 20 74 6f 20 62 65 20 | 72 65 67 69 73 74 65 72 |s to be |register|
|00000640| 65 64 20 61 73 20 61 20 | 54 43 50 20 73 65 72 76 |ed as a |TCP serv|
|00000650| 65 72 2e 20 20 0a 0a 49 | 66 20 79 6f 75 20 61 72 |er. ..I|f you ar|
|00000660| 65 20 72 75 6e 6e 69 6e | 67 20 75 6e 64 65 72 20 |e runnin|g under |
|00000670| 4d 53 20 57 69 6e 64 6f | 77 73 2c 20 79 6f 75 20 |MS Windo|ws, you |
|00000680| 63 61 6e 20 63 68 6f 6f | 73 65 20 61 6e 79 20 70 |can choo|se any p|
|00000690| 6f 72 74 20 6e 75 6d 62 | 65 72 20 69 6e 20 74 68 |ort numb|er in th|
|000006a0| 65 20 72 61 6e 67 65 20 | 66 72 6f 6d 20 30 20 74 |e range |from 0 t|
|000006b0| 6f 20 36 35 35 33 36 2e | 0a 0a 49 66 20 79 6f 75 |o 65536.|..If you|
|000006c0| 20 61 72 65 20 72 75 6e | 6e 69 6e 67 20 75 6e 64 | are run|ning und|
|000006d0| 65 72 20 55 6e 69 78 2c | 20 79 6f 75 20 6d 75 73 |er Unix,| you mus|
|000006e0| 74 20 63 68 6f 6f 73 65 | 20 61 20 70 6f 72 74 20 |t choose| a port |
|000006f0| 6e 75 6d 62 65 72 20 66 | 72 6f 6d 20 32 30 30 31 |number f|rom 2001|
|00000700| 20 74 6f 20 36 35 35 33 | 36 2e 20 20 59 6f 75 20 | to 6553|6. You |
|00000710| 6d 75 73 74 20 61 6c 73 | 6f 20 6d 61 6b 65 20 73 |must als|o make s|
|00000720| 75 72 65 20 74 68 61 74 | 20 74 68 65 72 65 20 69 |ure that| there i|
|00000730| 73 20 6e 6f 20 63 6f 6e | 66 6c 69 63 74 20 62 65 |s no con|flict be|
|00000740| 74 77 65 65 6e 20 74 68 | 65 20 6e 75 6d 62 65 72 |tween th|e number|
|00000750| 20 79 6f 75 20 63 68 6f | 6f 73 65 20 61 6e 64 20 | you cho|ose and |
|00000760| 61 6e 79 20 6f 66 20 74 | 68 65 20 61 73 73 69 67 |any of t|he assig|
|00000770| 6e 65 64 20 70 6f 72 74 | 20 6e 75 6d 62 65 72 73 |ned port| numbers|
|00000780| 20 69 6e 20 2f 65 74 63 | 2f 73 65 72 76 69 63 65 | in /etc|/service|
|00000790| 73 2e 00 00 00 00 06 08 | 00 00 00 00 54 68 65 20 |s.......|....The |
|000007a0| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 66 75 6e 63 |name of |the func|
|000007b0| 74 69 6f 6e 20 74 6f 20 | 62 65 20 63 61 6c 6c 65 |tion to |be calle|
|000007c0| 64 20 74 6f 20 70 72 6f | 63 65 73 73 20 63 6c 69 |d to pro|cess cli|
|000007d0| 65 6e 74 20 72 65 71 75 | 65 73 74 73 2e 20 20 41 |ent requ|ests. A|
|000007e0| 20 4e 55 4c 4c 20 70 6f | 69 6e 74 65 72 20 69 73 | NULL po|inter is|
|000007f0| 20 6e 6f 74 20 61 6c 6c | 6f 77 65 64 2e 20 0a 0a | not all|owed. ..|
|00000800| 54 68 65 20 63 61 6c 6c | 62 61 63 6b 20 66 75 6e |The call|back fun|
|00000810| 63 74 69 6f 6e 20 6d 75 | 73 74 20 62 65 20 6f 66 |ction mu|st be of|
|00000820| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 | the fol|lowing f|
|00000830| 6f 72 6d 3a 0a 0a 20 20 | 20 20 69 6e 74 20 28 2a |orm:.. | int (*|
|00000840| 74 63 70 46 75 6e 63 50 | 74 72 29 20 28 75 6e 73 |tcpFuncP|tr) (uns|
|00000850| 69 67 6e 65 64 20 68 61 | 6e 64 6c 65 2c 20 69 6e |igned ha|ndle, in|
|00000860| 74 20 78 54 79 70 65 2c | 20 69 6e 74 20 65 72 72 |t xType,| int err|
|00000870| 43 6f 64 65 2c 20 0a 20 | 20 20 20 20 20 20 20 20 |Code, . | |
|00000880| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 76 6f | | vo|
|00000890| 69 64 20 2a 63 61 6c 6c | 62 61 63 6b 44 61 74 61 |id *call|backData|
|000008a0| 29 3b 0a 20 0a 54 68 65 | 20 27 68 61 6e 64 6c 65 |);. .The| 'handle|
|000008b0| 27 20 70 61 72 61 6d 65 | 74 65 72 20 63 6f 6e 74 |' parame|ter cont|
|000008c0| 61 69 6e 73 20 61 20 76 | 61 6c 75 65 20 74 68 61 |ains a v|alue tha|
|000008d0| 74 20 69 73 20 75 6e 69 | 71 75 65 20 74 6f 20 65 |t is uni|que to e|
|000008e0| 61 63 68 20 63 6c 69 65 | 6e 74 2d 73 65 72 76 65 |ach clie|nt-serve|
|000008f0| 72 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 2e 0a 0a 54 |r connec|tion...T|
|00000900| 68 65 20 27 78 54 79 70 | 65 27 20 70 61 72 61 6d |he 'xTyp|e' param|
|00000910| 65 74 65 72 20 63 6f 6e | 74 61 69 6e 73 20 74 68 |eter con|tains th|
|00000920| 65 20 54 43 50 20 74 72 | 61 6e 73 61 63 74 69 6f |e TCP tr|ansactio|
|00000930| 6e 20 74 79 70 65 2e 20 | 20 54 68 65 20 66 6f 6c |n type. | The fol|
|00000940| 6c 6f 77 69 6e 67 20 6c | 69 73 74 20 73 70 65 63 |lowing l|ist spec|
|00000950| 69 66 69 65 73 20 61 6c | 6c 20 6f 66 20 74 68 65 |ifies al|l of the|
|00000960| 20 74 72 61 6e 73 61 63 | 74 69 6f 6e 20 74 79 70 | transac|tion typ|
|00000970| 65 73 20 74 68 61 74 20 | 63 61 6e 20 62 65 20 72 |es that |can be r|
|00000980| 65 63 65 69 76 65 64 20 | 62 79 20 73 65 72 76 65 |eceived |by serve|
|00000990| 72 73 3a 0a 0a 20 20 54 | 43 50 5f 43 4f 4e 4e 45 |rs:.. T|CP_CONNE|
|000009a0| 43 54 20 20 20 20 20 20 | 20 20 20 20 0a 20 20 54 |CT | . T|
|000009b0| 43 50 5f 44 49 53 43 4f | 4e 4e 45 43 54 20 20 20 |CP_DISCO|NNECT |
|000009c0| 20 20 20 20 20 20 20 0a | 20 20 54 43 50 5f 44 41 | .| TCP_DA|
|000009d0| 54 41 52 45 41 44 59 20 | 20 20 20 20 20 20 20 20 |TAREADY | |
|000009e0| 20 20 0a 0a 0a 54 68 65 | 20 27 65 72 72 43 6f 64 | ...The| 'errCod|
|000009f0| 65 27 20 70 61 72 61 6d | 65 74 65 72 20 69 73 20 |e' param|eter is |
|00000a00| 75 73 65 64 20 6f 6e 6c | 79 20 77 68 65 6e 20 74 |used onl|y when t|
|00000a10| 68 65 20 74 72 61 6e 73 | 61 63 74 69 6f 6e 20 74 |he trans|action t|
|00000a20| 79 70 65 20 69 73 20 54 | 43 50 5f 44 49 53 43 4f |ype is T|CP_DISCO|
|00000a30| 4e 4e 45 43 54 2e 0a 0a | 54 68 65 20 66 6f 6c 6c |NNECT...|The foll|
|00000a40| 6f 77 69 6e 67 20 64 65 | 73 63 72 69 62 65 73 20 |owing de|scribes |
|00000a50| 65 61 63 68 20 74 72 61 | 6e 73 61 63 74 69 6f 6e |each tra|nsaction|
|00000a60| 20 74 79 70 65 2e 0a 0a | 54 43 50 5f 43 4f 4e 4e | type...|TCP_CONN|
|00000a70| 45 43 54 20 2d 20 54 68 | 65 20 74 72 61 6e 73 61 |ECT - Th|e transa|
|00000a80| 63 74 69 6f 6e 20 74 79 | 70 65 20 69 73 20 72 65 |ction ty|pe is re|
|00000a90| 63 65 69 76 65 64 20 77 | 68 65 6e 20 61 20 63 6c |ceived w|hen a cl|
|00000aa0| 69 65 6e 74 20 69 73 20 | 72 65 71 75 65 73 74 69 |ient is |requesti|
|00000ab0| 6e 67 20 61 20 63 6f 6e | 6e 65 63 74 69 6f 6e 2e |ng a con|nection.|
|00000ac0| 0a 0a 54 43 50 5f 44 49 | 53 43 4f 4e 4e 45 43 54 |..TCP_DI|SCONNECT|
|00000ad0| 20 2d 20 52 65 63 65 69 | 76 65 64 20 77 68 65 6e | - Recei|ved when|
|00000ae0| 20 61 20 63 6c 69 65 6e | 74 20 69 73 20 72 65 71 | a clien|t is req|
|00000af0| 75 65 73 74 69 6e 67 20 | 74 68 65 20 74 65 72 6d |uesting |the term|
|00000b00| 69 6e 61 74 69 6f 6e 20 | 6f 66 20 61 20 63 6f 6e |ination |of a con|
|00000b10| 6e 65 63 74 69 6f 6e 2c | 20 6f 72 20 77 68 65 6e |nection,| or when|
|00000b20| 20 61 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 20 69 73 | a conne|ction is|
|00000b30| 20 62 65 69 6e 67 20 74 | 65 72 6d 69 6e 61 74 65 | being t|erminate|
|00000b40| 64 20 64 75 65 20 74 6f | 20 61 6e 20 65 72 72 6f |d due to| an erro|
|00000b50| 72 2e 20 20 49 66 20 74 | 68 65 20 63 6f 6e 6e 65 |r. If t|he conne|
|00000b60| 63 74 69 6f 6e 20 69 73 | 20 62 65 69 6e 67 20 74 |ction is| being t|
|00000b70| 65 72 6d 69 6e 61 74 65 | 64 20 64 75 65 20 74 6f |erminate|d due to|
|00000b80| 20 61 6e 20 65 72 72 6f | 72 2c 20 74 68 65 20 27 | an erro|r, the '|
|00000b90| 65 72 72 43 6f 64 65 27 | 20 70 61 72 61 6d 65 74 |errCode'| paramet|
|00000ba0| 65 72 20 63 6f 6e 74 61 | 69 6e 73 20 61 20 6e 65 |er conta|ins a ne|
|00000bb0| 67 61 74 69 76 65 20 65 | 72 72 6f 72 20 63 6f 64 |gative e|rror cod|
|00000bc0| 65 2e 20 20 4f 74 68 65 | 72 77 69 73 65 20 74 68 |e. Othe|rwise th|
|00000bd0| 65 20 27 65 72 72 43 6f | 64 65 27 20 70 61 72 61 |e 'errCo|de' para|
|00000be0| 6d 65 74 65 72 20 63 6f | 6e 74 61 69 6e 73 20 7a |meter co|ntains z|
|00000bf0| 65 72 6f 2e 20 20 28 53 | 65 65 20 74 68 65 20 68 |ero. (S|ee the h|
|00000c00| 65 6c 70 20 66 6f 72 20 | 74 68 65 20 53 74 61 74 |elp for |the Stat|
|00000c10| 75 73 20 63 6f 6e 74 72 | 6f 6c 20 66 6f 72 20 74 |us contr|ol for t|
|00000c20| 68 65 20 6c 69 73 74 20 | 6f 66 20 65 72 72 6f 72 |he list |of error|
|00000c30| 20 63 6f 64 65 20 76 61 | 6c 75 65 73 2e 29 0a 0a | code va|lues.)..|
|00000c40| 54 43 50 5f 44 41 54 41 | 52 45 41 44 59 20 2d 20 |TCP_DATA|READY - |
|00000c50| 52 65 63 65 69 76 65 64 | 20 77 68 65 6e 20 74 68 |Received| when th|
|00000c60| 65 20 63 6c 69 65 6e 74 | 20 68 61 73 20 73 65 6e |e client| has sen|
|00000c70| 74 20 64 61 74 61 20 76 | 69 61 20 54 43 50 20 74 |t data v|ia TCP t|
|00000c80| 6f 20 74 68 65 20 73 65 | 72 76 65 72 2e 20 20 59 |o the se|rver. Y|
|00000c90| 6f 75 72 20 70 72 6f 67 | 72 61 6d 2c 20 61 63 74 |our prog|ram, act|
|00000ca0| 69 6e 67 20 61 73 20 74 | 68 65 20 73 65 72 76 65 |ing as t|he serve|
|00000cb0| 72 2c 20 73 68 6f 75 6c | 64 20 63 61 6c 6c 20 0a |r, shoul|d call .|
|00000cc0| 53 65 72 76 65 72 54 43 | 50 52 65 61 64 20 74 6f |ServerTC|PRead to|
|00000cd0| 20 6f 62 74 61 69 6e 20 | 74 68 65 20 64 61 74 61 | obtain |the data|
|00000ce0| 2e 0a 0a 52 65 6d 61 72 | 6b 73 3a 0a 2d 2d 2d 2d |...Remar|ks:.----|
|00000cf0| 2d 2d 2d 2d 0a 54 68 65 | 20 63 61 6c 6c 62 61 63 |----.The| callbac|
|00000d00| 6b 20 66 75 6e 63 74 69 | 6f 6e 20 73 68 6f 75 6c |k functi|on shoul|
|00000d10| 64 20 72 65 74 75 72 6e | 20 54 52 55 45 20 69 66 |d return| TRUE if|
|00000d20| 20 74 68 65 20 72 65 71 | 75 65 73 74 20 69 73 20 | the req|uest is |
|00000d30| 73 75 63 63 65 73 73 66 | 75 6c 20 61 6e 64 20 72 |successf|ul and r|
|00000d40| 65 74 75 72 6e 20 46 41 | 4c 53 45 20 69 66 20 69 |eturn FA|LSE if i|
|00000d50| 74 20 69 73 20 6e 6f 74 | 2e 20 20 0a 0a 54 68 65 |t is not|. ..The|
|00000d60| 20 63 61 6c 6c 62 61 63 | 6b 20 66 75 6e 63 74 69 | callbac|k functi|
|00000d70| 6f 6e 20 73 68 6f 75 6c | 64 20 62 65 20 73 68 6f |on shoul|d be sho|
|00000d80| 72 74 20 61 6e 64 20 72 | 65 74 75 72 6e 20 61 73 |rt and r|eturn as|
|00000d90| 20 73 6f 6f 6e 20 61 73 | 20 70 6f 73 73 69 62 6c | soon as| possibl|
|00000da0| 65 2e 00 00 00 00 06 f4 | 00 00 00 00 52 65 74 75 |e.......|....Retu|
|00000db0| 72 6e 20 76 61 6c 75 65 | 20 69 6e 64 69 63 61 74 |rn value| indicat|
|00000dc0| 69 6e 67 20 77 68 65 74 | 68 65 72 20 74 68 65 20 |ing whet|her the |
|00000dd0| 66 75 6e 63 74 69 6f 6e | 20 77 61 73 20 73 75 63 |function| was suc|
|00000de0| 63 65 73 73 66 75 6c 2e | 20 20 55 6e 6c 65 73 73 |cessful.| Unless|
|00000df0| 20 6f 74 68 65 72 77 69 | 73 65 20 73 74 61 74 65 | otherwi|se state|
|00000e00| 64 2c 20 7a 65 72 6f 20 | 72 65 70 72 65 73 65 6e |d, zero |represen|
|00000e10| 74 73 20 73 75 63 63 65 | 73 73 66 75 6c 20 65 78 |ts succe|ssful ex|
|00000e20| 65 63 75 74 69 6f 6e 20 | 61 6e 64 20 61 20 6e 65 |ecution |and a ne|
|00000e30| 67 61 74 69 76 65 20 6e | 75 6d 62 65 72 20 72 65 |gative n|umber re|
|00000e40| 70 72 65 73 65 6e 74 73 | 20 74 68 65 20 65 72 72 |presents| the err|
|00000e50| 6f 72 20 63 6f 64 65 2e | 20 0a 0a 46 6f 72 20 66 |or code.| ..For f|
|00000e60| 75 6e 63 74 69 6f 6e 73 | 20 74 68 61 74 20 72 65 |unctions| that re|
|00000e70| 61 64 20 6f 72 20 77 72 | 69 74 65 20 64 61 74 61 |ad or wr|ite data|
|00000e80| 20 28 43 6c 69 65 6e 74 | 54 43 50 52 65 61 64 2c | (Client|TCPRead,|
|00000e90| 20 43 6c 69 65 6e 74 54 | 43 50 57 72 69 74 65 2c | ClientT|CPWrite,|
|00000ea0| 20 53 65 72 76 65 72 54 | 43 50 57 72 69 74 65 2c | ServerT|CPWrite,|
|00000eb0| 20 53 65 72 76 65 72 54 | 43 50 57 72 69 74 65 29 | ServerT|CPWrite)|
|00000ec0| 2c 20 69 66 20 74 68 65 | 20 66 75 6e 63 74 69 6f |, if the| functio|
|00000ed0| 6e 20 77 61 73 20 73 75 | 63 63 65 73 73 66 75 6c |n was su|ccessful|
|00000ee0| 2c 20 74 68 65 20 72 65 | 74 75 72 6e 20 76 61 6c |, the re|turn val|
|00000ef0| 75 65 20 69 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |ue is th|e number|
|00000f00| 20 6f 66 20 62 79 74 65 | 73 20 74 72 61 6e 73 66 | of byte|s transf|
|00000f10| 65 72 72 65 64 2e 0a 0a | 54 68 65 20 66 6f 6c 6c |erred...|The foll|
|00000f20| 6f 77 69 6e 67 20 65 6e | 75 6d 65 72 61 74 65 64 |owing en|umerated|
|00000f30| 20 74 79 70 65 20 69 73 | 20 64 65 63 6c 61 72 65 | type is| declare|
|00000f40| 64 20 69 6e 20 74 63 70 | 73 75 70 70 2e 68 2e 20 |d in tcp|supp.h. |
|00000f50| 20 0a 49 74 20 73 70 65 | 66 69 63 69 65 73 20 74 | .It spe|ficies t|
|00000f60| 68 65 20 61 62 73 6f 6c | 75 74 65 20 76 61 6c 75 |he absol|ute valu|
|00000f70| 65 73 20 6f 66 20 74 68 | 65 20 65 72 72 6f 72 20 |es of th|e error |
|00000f80| 63 6f 64 65 73 2e 20 20 | 46 6f 72 20 69 6e 73 74 |codes. |For inst|
|00000f90| 61 6e 63 65 2c 20 61 20 | 27 72 65 61 64 20 66 61 |ance, a |'read fa|
|00000fa0| 69 6c 27 20 65 72 72 6f | 72 20 6f 63 63 75 72 73 |il' erro|r occurs|
|00000fb0| 2c 20 2d 6b 54 43 50 5f | 52 65 61 64 46 61 69 6c |, -kTCP_|ReadFail|
|00000fc0| 65 64 20 69 73 20 72 65 | 74 75 72 6e 65 64 2e 0a |ed is re|turned..|
|00000fd0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000fe0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ff0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 76 61 | | va|
|00001000| 6c 75 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |lue. | |
|00001010| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001030| 20 2d 2d 2d 2d 2d 0a 20 | 2d 6b 54 43 50 5f 4e 6f | -----. |-kTCP_No|
|00001040| 45 72 72 6f 72 20 20 20 | 20 20 20 20 20 20 20 20 |Error | |
|00001050| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001060| 20 20 20 20 20 20 30 0a | 20 2d 6b 54 43 50 5f 55 | 0.| -kTCP_U|
|00001070| 6e 61 62 6c 65 54 6f 52 | 65 67 69 73 74 65 72 53 |nableToR|egisterS|
|00001080| 65 72 76 69 63 65 20 20 | 20 20 20 20 20 20 20 20 |ervice | |
|00001090| 20 20 20 20 20 20 2d 31 | 0a 20 2d 6b 54 43 50 5f | -1|. -kTCP_|
|000010a0| 55 6e 61 62 6c 65 54 6f | 45 73 74 61 62 6c 69 73 |UnableTo|Establis|
|000010b0| 68 43 6f 6e 6e 65 63 74 | 69 6f 6e 20 20 20 20 20 |hConnect|ion |
|000010c0| 20 20 20 20 20 20 20 2d | 32 0a 20 2d 6b 54 43 50 | -|2. -kTCP|
|000010d0| 5f 45 78 69 73 74 69 6e | 67 53 65 72 76 65 72 20 |_Existin|gServer |
|000010e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000010f0| 20 20 20 20 20 20 20 20 | 2d 33 0a 20 2d 6b 54 43 | |-3. -kTC|
|00001100| 50 5f 46 61 69 6c 65 64 | 54 6f 43 6f 6e 6e 65 63 |P_Failed|ToConnec|
|00001110| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00001120| 20 20 20 20 20 20 20 20 | 20 2d 34 0a 20 2d 6b 54 | | -4. -kT|
|00001130| 43 50 5f 53 65 72 76 65 | 72 4e 6f 74 52 65 67 69 |CP_Serve|rNotRegi|
|00001140| 73 74 65 72 65 64 20 20 | 20 20 20 20 20 20 20 20 |stered | |
|00001150| 20 20 20 20 20 20 20 20 | 20 20 2d 35 0a 20 2d 6b | | -5. -k|
|00001160| 54 43 50 5f 54 6f 6f 4d | 61 6e 79 43 6f 6e 76 65 |TCP_TooM|anyConve|
|00001170| 72 73 61 74 69 6f 6e 73 | 20 20 20 20 20 20 20 20 |rsations| |
|00001180| 20 20 20 20 20 20 20 20 | 20 20 20 2d 36 0a 20 2d | | -6. -|
|00001190| 6b 54 43 50 5f 52 65 61 | 64 46 61 69 6c 65 64 20 |kTCP_Rea|dFailed |
|000011a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000011b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2d 37 0a 20 | | -7. |
|000011c0| 2d 6b 54 43 50 5f 57 72 | 69 74 65 46 61 69 6c 65 |-kTCP_Wr|iteFaile|
|000011d0| 64 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |d | |
|000011e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2d 38 0a | | -8.|
|000011f0| 20 2d 6b 54 43 50 5f 49 | 6e 76 61 6c 69 64 50 61 | -kTCP_I|nvalidPa|
|00001200| 72 61 6d 65 74 65 72 20 | 20 20 20 20 20 20 20 20 |rameter | |
|00001210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2d 39 | | -9|
|00001220| 0a 20 2d 6b 54 43 50 5f | 4f 75 74 4f 66 4d 65 6d |. -kTCP_|OutOfMem|
|00001230| 6f 72 79 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |ory | |
|00001240| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|00001250| 31 30 0a 20 2d 6b 54 43 | 50 5f 54 69 6d 65 4f 75 |10. -kTC|P_TimeOu|
|00001260| 74 45 72 72 20 20 20 20 | 20 20 20 20 20 20 20 20 |tErr | |
|00001270| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001280| 20 2d 31 31 0a 20 2d 6b | 54 43 50 5f 4e 6f 43 6f | -11. -k|TCP_NoCo|
|00001290| 6e 6e 65 63 74 69 6f 6e | 45 73 74 61 62 6c 69 73 |nnection|Establis|
|000012a0| 68 65 64 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |hed | |
|000012b0| 20 20 20 2d 31 32 0a 20 | 2d 6b 54 43 50 5f 47 65 | -12. |-kTCP_Ge|
|000012c0| 6e 65 72 61 6c 49 4f 45 | 72 72 20 20 20 20 20 20 |neralIOE|rr |
|000012d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012e0| 20 20 20 20 20 2d 31 33 | 0a 20 2d 6b 54 43 50 5f | -13|. -kTCP_|
|000012f0| 43 6f 6e 6e 65 63 74 69 | 6f 6e 43 6c 6f 73 65 64 |Connecti|onClosed|
|00001300| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001310| 20 20 20 20 20 20 20 2d | 31 34 0a 20 2d 6b 54 43 | -|14. -kTC|
|00001320| 50 5f 55 6e 61 62 6c 65 | 54 6f 4c 6f 61 64 57 69 |P_Unable|ToLoadWi|
|00001330| 6e 73 6f 63 6b 44 4c 4c | 20 20 20 20 20 20 20 20 |nsockDLL| |
|00001340| 20 20 20 20 20 20 20 20 | 20 2d 31 35 0a 20 2d 6b | | -15. -k|
|00001350| 54 43 50 5f 49 6e 63 6f | 72 72 65 63 74 57 69 6e |TCP_Inco|rrectWin|
|00001360| 73 6f 63 6b 44 4c 4c 56 | 65 72 73 69 6f 6e 20 20 |sockDLLV|ersion |
|00001370| 20 20 20 20 20 20 20 20 | 20 20 20 2d 31 36 0a 20 | | -16. |
|00001380| 2d 6b 54 43 50 5f 4e 65 | 74 77 6f 72 6b 53 75 62 |-kTCP_Ne|tworkSub|
|00001390| 73 79 73 74 65 6d 4e 6f | 74 52 65 61 64 79 20 20 |systemNo|tReady |
|000013a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2d 31 37 | | -17|
|000013b0| 0a 20 2d 6b 54 43 50 5f | 43 6f 6e 6e 65 63 74 69 |. -kTCP_|Connecti|
|000013c0| 6f 6e 73 53 74 69 6c 6c | 4f 70 65 6e 20 20 20 20 |onsStill|Open |
|000013d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|000013e0| 31 38 0a 0a 52 65 6d 61 | 72 6b 73 3a 0a 2d 2d 2d |18..Rema|rks:.---|
|000013f0| 2d 2d 2d 2d 2d 0a 43 75 | 72 72 65 6e 74 6c 79 2c |-----.Cu|rrently,|
|00001400| 20 74 68 65 72 65 20 65 | 78 69 73 74 73 20 61 6e | there e|xists an|
|00001410| 20 75 70 70 65 72 20 6c | 69 6d 69 74 20 6f 66 20 | upper l|imit of |
|00001420| 32 35 35 20 63 6f 6e 63 | 75 72 72 65 6e 74 20 63 |255 conc|urrent c|
|00001430| 6f 6e 76 65 72 73 61 74 | 69 6f 6e 73 20 61 6c 6c |onversat|ions all|
|00001440| 6f 77 65 64 20 61 74 20 | 61 6e 79 20 6f 6e 65 20 |owed at |any one |
|00001450| 74 69 6d 65 2e 20 20 49 | 66 20 79 6f 75 20 65 78 |time. I|f you ex|
|00001460| 63 65 65 64 20 74 68 69 | 73 0a 6c 69 6d 69 74 2c |ceed thi|s.limit,|
|00001470| 20 2d 6b 54 43 50 5f 54 | 6f 6f 4d 61 6e 79 43 6f | -kTCP_T|ooManyCo|
|00001480| 6e 76 65 72 73 61 74 69 | 6f 6e 73 20 77 69 6c 6c |nversati|ons will|
|00001490| 20 62 65 20 72 65 74 75 | 72 6e 65 64 2e 0a 00 00 | be retu|rned....|
|000014a0| 00 00 03 15 00 00 00 00 | 41 20 66 6f 75 72 2d 62 |........|A four-b|
|000014b0| 79 74 65 20 76 61 6c 75 | 65 20 74 68 61 74 20 77 |yte valu|e that w|
|000014c0| 69 6c 6c 20 62 65 20 70 | 61 73 73 65 64 20 74 6f |ill be p|assed to|
|000014d0| 20 74 68 65 20 63 61 6c | 6c 62 61 63 6b 20 66 75 | the cal|lback fu|
|000014e0| 6e 63 74 69 6f 6e 20 65 | 61 63 68 20 74 69 6d 65 |nction e|ach time|
|000014f0| 20 69 74 20 69 73 20 63 | 61 6c 6c 65 64 20 66 6f | it is c|alled fo|
|00001500| 72 20 74 68 65 20 73 65 | 72 76 65 72 2e 0a 0a 49 |r the se|rver...I|
|00001510| 74 20 69 73 20 75 70 20 | 74 6f 20 79 6f 75 20 74 |t is up |to you t|
|00001520| 6f 20 64 65 66 69 6e 65 | 20 74 68 65 20 6d 65 61 |o define| the mea|
|00001530| 6e 69 6e 67 20 6f 66 20 | 74 68 65 20 63 61 6c 6c |ning of |the call|
|00001540| 62 61 63 6b 20 64 61 74 | 61 2e 20 20 0a 54 68 65 |back dat|a. .The|
|00001550| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 61 72 65 20 65 | followi|ng are e|
|00001560| 78 61 6d 70 6c 65 73 20 | 6f 66 20 68 6f 77 20 74 |xamples |of how t|
|00001570| 68 65 20 63 61 6c 6c 62 | 61 63 6b 20 64 61 74 61 |he callb|ack data|
|00001580| 20 63 61 6e 20 62 65 20 | 75 73 65 64 3a 0a 0a 20 | can be |used:.. |
|00001590| 20 20 20 31 2e 20 20 59 | 6f 75 20 63 61 6e 20 72 | 1. Y|ou can r|
|000015a0| 65 67 69 73 74 65 72 20 | 79 6f 75 72 20 70 72 6f |egister |your pro|
|000015b0| 67 72 61 6d 20 61 73 20 | 61 20 54 43 50 20 73 65 |gram as |a TCP se|
|000015c0| 72 76 65 72 20 6d 75 6c | 74 69 70 6c 65 0a 20 20 |rver mul|tiple. |
|000015d0| 20 20 20 20 20 20 74 69 | 6d 65 73 20 75 6e 64 65 | ti|mes unde|
|000015e0| 72 20 64 69 66 66 65 72 | 65 6e 74 20 70 6f 72 74 |r differ|ent port|
|000015f0| 20 6e 75 6d 62 65 72 73 | 2e 20 20 59 6f 75 20 63 | numbers|. You c|
|00001600| 6f 75 6c 64 20 75 73 65 | 20 74 68 65 20 20 20 20 |ould use| the |
|00001610| 20 0a 20 20 20 20 20 20 | 20 20 73 61 6d 65 20 63 | . | same c|
|00001620| 61 6c 6c 62 61 63 6b 20 | 66 75 6e 63 74 69 6f 6e |allback |function|
|00001630| 20 66 6f 72 20 61 6c 6c | 20 6f 66 20 74 68 65 20 | for all| of the |
|00001640| 73 65 72 76 65 72 20 69 | 6e 73 74 61 6e 63 65 73 |server i|nstances|
|00001650| 0a 20 20 20 20 20 20 20 | 20 62 79 20 75 73 69 6e |. | by usin|
|00001660| 67 20 74 68 65 20 63 61 | 6c 6c 62 61 63 6b 20 64 |g the ca|llback d|
|00001670| 61 74 61 20 74 6f 20 64 | 69 66 66 65 72 65 6e 74 |ata to d|ifferent|
|00001680| 69 61 74 65 20 62 65 74 | 77 65 65 6e 0a 20 20 20 |iate bet|ween. |
|00001690| 20 20 20 20 20 74 68 65 | 6d 2e 0a 0a 20 20 20 20 | the|m... |
|000016a0| 32 2e 20 20 59 6f 75 20 | 63 61 6e 20 75 73 65 20 |2. You |can use |
|000016b0| 74 68 65 20 63 61 6c 6c | 62 61 63 6b 20 64 61 74 |the call|back dat|
|000016c0| 61 20 74 6f 20 70 6f 69 | 6e 74 20 74 6f 20 61 20 |a to poi|nt to a |
|000016d0| 64 61 74 61 20 6f 62 6a | 65 63 74 0a 20 20 20 20 |data obj|ect. |
|000016e0| 20 20 20 20 74 68 61 74 | 20 79 6f 75 20 6e 65 65 | that| you nee|
|000016f0| 64 20 74 6f 20 61 63 63 | 65 73 73 20 69 6e 20 74 |d to acc|ess in t|
|00001700| 68 65 20 63 61 6c 6c 62 | 61 63 6b 20 66 75 6e 63 |he callb|ack func|
|00001710| 74 69 6f 6e 2e 20 20 49 | 6e 20 20 20 20 20 20 0a |tion. I|n .|
|00001720| 20 20 20 20 20 20 20 20 | 74 68 69 73 20 77 61 79 | |this way|
|00001730| 2c 20 79 6f 75 20 77 6f | 75 6c 64 20 6e 6f 74 20 |, you wo|uld not |
|00001740| 6e 65 65 64 20 74 6f 20 | 64 65 63 6c 61 72 65 20 |need to |declare |
|00001750| 74 68 65 20 64 61 74 61 | 20 6f 62 6a 65 63 74 0a |the data| object.|
|00001760| 20 20 20 20 20 20 20 20 | 61 73 20 61 20 67 6c 6f | |as a glo|
|00001770| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 2e 0a 0a 49 |bal vari|able...I|
|00001780| 66 20 79 6f 75 20 64 6f | 20 6e 6f 74 20 77 61 6e |f you do| not wan|
|00001790| 74 20 74 6f 20 75 73 65 | 20 74 68 65 20 63 61 6c |t to use| the cal|
|000017a0| 6c 62 61 63 6b 20 64 61 | 74 61 2c 20 79 6f 75 20 |lback da|ta, you |
|000017b0| 63 61 6e 20 70 61 73 73 | 20 30 2e 00 00 00 00 05 |can pass| 0......|
|000017c0| fe 00 4f 00 2c 00 00 00 | 04 01 00 00 00 00 00 00 |..O.,...|........|
|000017d0| 00 50 6f 72 74 20 4e 75 | 6d 62 65 72 00 00 00 00 |.Port Nu|mber....|
|000017e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000017f0| 00 00 00 07 94 00 4f 00 | e5 00 01 03 e8 01 00 00 |......O.|........|
|00001800| 00 00 00 00 00 43 61 6c | 6c 62 61 63 6b 20 46 75 |.....Cal|lback Fu|
|00001810| 6e 63 74 69 6f 6e 00 00 | 00 00 00 00 00 00 00 00 |nction..|........|
|00001820| 00 00 00 00 00 00 00 0d | a4 00 f6 01 9d ff ff 00 |........|........|
|00001830| 00 06 00 00 00 00 00 00 | 00 53 74 61 74 75 73 00 |........|.Status.|
|00001840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001850| 00 00 00 00 00 00 00 00 | 00 00 00 14 a0 00 4f 01 |........|......O.|
|00001860| 9f 00 02 00 16 01 00 00 | 00 00 00 00 00 43 61 6c |........|.....Cal|
|00001870| 6c 62 61 63 6b 20 44 61 | 74 61 00 00 00 00 00 00 |lback Da|ta......|
|00001880| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001890| 02 30 00 00 00 00 01 00 | 00 00 00 09 00 00 00 00 |.0......|........|
|000018a0| 00 00 00 00 00 00 00 00 | 02 30 00 00 00 01 65 00 |........|.0....e.|
|000018b0| 00 00 00 54 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |...This |function|
|000018c0| 20 61 6c 6c 6f 77 73 20 | 79 6f 75 72 20 70 72 6f | allows |your pro|
|000018d0| 67 72 61 6d 2c 20 61 63 | 74 69 6e 67 20 61 73 20 |gram, ac|ting as |
|000018e0| 61 20 54 43 50 20 73 65 | 72 76 65 72 2c 20 74 6f |a TCP se|rver, to|
|000018f0| 20 72 65 61 64 20 64 61 | 74 61 20 66 72 6f 6d 20 | read da|ta from |
|00001900| 61 20 63 6c 69 65 6e 74 | 2e 20 54 68 65 20 66 75 |a client|. The fu|
|00001910| 6e 63 74 69 6f 6e 20 77 | 61 69 74 73 20 75 6e 74 |nction w|aits unt|
|00001920| 69 6c 20 74 68 65 20 64 | 61 74 61 20 69 73 20 72 |il the d|ata is r|
|00001930| 65 63 65 69 76 65 64 20 | 6f 72 20 72 65 74 75 72 |eceived |or retur|
|00001940| 6e 73 20 77 68 65 6e 20 | 74 69 6d 65 20 6f 75 74 |ns when |time out|
|00001950| 20 68 61 73 20 65 78 70 | 69 72 65 64 2e 0a 0a 49 | has exp|ired...I|
|00001960| 66 20 73 75 63 63 65 73 | 73 66 75 6c 2c 20 74 68 |f succes|sful, th|
|00001970| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 72 65 74 75 |is funct|ion retu|
|00001980| 72 6e 73 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |rns the |number o|
|00001990| 66 20 62 79 74 65 73 20 | 72 65 61 64 2e 20 20 4f |f bytes |read. O|
|000019a0| 74 68 65 72 77 69 73 65 | 2c 20 74 68 69 73 20 66 |therwise|, this f|
|000019b0| 75 6e 63 74 69 6f 6e 20 | 72 65 74 75 72 6e 73 20 |unction |returns |
|000019c0| 61 20 6e 65 67 61 74 69 | 76 65 20 65 72 72 6f 72 |a negati|ve error|
|000019d0| 20 63 6f 64 65 2e 20 20 | 53 65 65 20 74 68 65 20 | code. |See the |
|000019e0| 68 65 6c 70 20 66 6f 72 | 20 74 68 65 20 53 74 61 |help for| the Sta|
|000019f0| 74 75 73 20 63 6f 6e 74 | 72 6f 6c 20 66 6f 72 20 |tus cont|rol for |
|00001a00| 74 68 65 20 65 72 72 6f | 72 20 63 6f 64 65 20 76 |the erro|r code v|
|00001a10| 61 6c 75 65 73 2e 00 00 | 00 00 00 66 00 00 00 00 |alues...|...f....|
|00001a20| 54 68 65 20 63 6f 6e 76 | 65 72 73 61 74 69 6f 6e |The conv|ersation|
|00001a30| 20 68 61 6e 64 6c 65 20 | 74 68 61 74 20 75 6e 69 | handle |that uni|
|00001a40| 71 75 65 6c 79 20 72 65 | 70 72 65 73 65 6e 74 73 |quely re|presents|
|00001a50| 20 74 68 65 20 63 6f 6e | 6e 65 63 74 69 6f 6e 20 | the con|nection |
|00001a60| 62 65 74 77 65 65 6e 20 | 74 68 65 20 73 65 72 76 |between |the serv|
|00001a70| 65 72 20 61 6e 64 20 74 | 68 65 20 63 6c 69 65 6e |er and t|he clien|
|00001a80| 74 2e 20 0a 00 00 00 00 | 00 52 00 00 00 00 54 68 |t. .....|.R....Th|
|00001a90| 65 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |e pointe|r to the|
|00001aa0| 20 62 75 66 66 65 72 20 | 77 68 65 72 65 20 74 68 | buffer |where th|
|00001ab0| 65 20 64 61 74 61 20 69 | 73 20 74 6f 20 62 65 20 |e data i|s to be |
|00001ac0| 73 74 6f 72 65 64 2e 20 | 0a 0a 4e 55 4c 4c 20 69 |stored. |..NULL i|
|00001ad0| 73 20 6e 6f 74 20 61 6c | 6c 6f 77 65 64 2e 00 00 |s not al|lowed...|
|00001ae0| 00 00 00 6d 00 00 00 00 | 54 68 65 20 6d 61 78 69 |...m....|The maxi|
|00001af0| 6d 75 6d 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 79 |mum numb|er of by|
|00001b00| 74 65 73 20 74 6f 20 62 | 65 20 72 65 61 64 2e 20 |tes to b|e read. |
|00001b10| 20 54 68 69 73 20 73 68 | 6f 75 6c 64 20 62 65 20 | This sh|ould be |
|00001b20| 6c 65 73 73 20 74 68 61 | 6e 20 6f 72 20 65 71 75 |less tha|n or equ|
|00001b30| 61 6c 20 74 6f 20 74 68 | 65 20 73 69 7a 65 20 6f |al to th|e size o|
|00001b40| 66 20 74 68 65 20 64 61 | 74 61 20 62 75 66 66 65 |f the da|ta buffe|
|00001b50| 72 2e 20 00 00 00 00 01 | 43 00 00 00 00 54 68 65 |r. .....|C....The|
|00001b60| 20 6e 75 6d 62 65 72 20 | 6f 66 20 6d 69 6c 6c 69 | number |of milli|
|00001b70| 73 65 63 6f 6e 64 73 20 | 74 6f 20 77 61 69 74 20 |seconds |to wait |
|00001b80| 64 75 72 69 6e 67 20 61 | 6e 79 20 70 61 75 73 65 |during a|ny pause|
|00001b90| 20 69 6e 20 74 68 65 20 | 54 43 50 20 72 65 61 64 | in the |TCP read|
|00001ba0| 20 6f 72 20 77 72 69 74 | 65 20 6f 70 65 72 61 74 | or writ|e operat|
|00001bb0| 69 6f 6e 2e 20 20 46 6f | 72 20 69 6e 73 74 61 6e |ion. Fo|r instan|
|00001bc0| 63 65 2c 20 69 66 20 61 | 20 76 61 6c 75 65 20 6f |ce, if a| value o|
|00001bd0| 66 20 31 30 30 20 69 73 | 20 70 61 73 73 65 64 2c |f 100 is| passed,|
|00001be0| 20 74 68 65 6e 20 74 68 | 65 20 66 75 6e 63 74 69 | then th|e functi|
|00001bf0| 6f 6e 20 77 69 6c 6c 20 | 72 65 74 75 72 6e 20 61 |on will |return a|
|00001c00| 6e 20 65 72 72 6f 72 20 | 69 66 20 31 30 30 20 6d |n error |if 100 m|
|00001c10| 69 6c 6c 69 73 65 63 6f | 6e 64 73 20 70 61 73 73 |illiseco|nds pass|
|00001c20| 65 73 20 77 69 74 68 6f | 75 74 20 61 20 62 79 74 |es witho|ut a byt|
|00001c30| 65 20 62 65 69 6e 67 20 | 72 65 61 64 20 6f 72 20 |e being |read or |
|00001c40| 77 72 69 74 74 65 6e 2e | 20 20 0a 0a 49 66 20 61 |written.| ..If a|
|00001c50| 20 76 61 6c 75 65 20 6f | 66 20 7a 65 72 6f 20 69 | value o|f zero i|
|00001c60| 73 20 70 61 73 73 65 64 | 2c 20 74 68 65 6e 20 61 |s passed|, then a|
|00001c70| 20 64 65 66 61 75 6c 74 | 20 74 69 6d 65 6f 75 74 | default| timeout|
|00001c80| 20 6f 66 20 35 30 30 30 | 20 6d 69 6c 6c 69 73 65 | of 5000| millise|
|00001c90| 63 6f 6e 64 73 20 69 73 | 20 75 73 65 64 2e 00 00 |conds is| used...|
|00001ca0| 00 00 0d a4 00 f6 01 97 | ff ff 00 00 06 00 00 00 |........|........|
|00001cb0| 00 00 00 00 53 74 61 74 | 75 73 00 00 00 00 00 00 |....Stat|us......|
|00001cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cd0| 00 00 00 00 00 00 1a 18 | 00 4d 00 48 00 00 00 04 |........|.M.H....|
|00001ce0| 01 00 00 00 00 00 00 00 | 43 6f 6e 76 65 72 73 61 |........|Conversa|
|00001cf0| 74 69 6f 6e 20 48 61 6e | 64 6c 65 00 00 00 00 00 |tion Han|dle.....|
|00001d00| 00 00 00 00 00 00 00 00 | 00 00 1a 86 00 4d 00 ef |........|.....M..|
|00001d10| 00 01 00 19 01 00 00 00 | 00 00 00 00 44 61 74 61 |........|....Data|
|00001d20| 20 42 75 66 66 65 72 00 | 00 00 00 00 00 00 00 00 | Buffer.|........|
|00001d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 1a e0 |........|........|
|00001d40| 00 4d 01 97 00 02 00 04 | 01 00 00 00 00 00 00 00 |.M......|........|
|00001d50| 44 61 74 61 20 53 69 7a | 65 00 00 00 00 00 00 00 |Data Siz|e.......|
|00001d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d70| 00 00 1b 55 00 b0 00 47 | 00 03 00 04 01 00 00 00 |...U...G|........|
|00001d80| 00 00 00 00 54 69 6d 65 | 20 4f 75 74 00 00 00 00 |....Time| Out....|
|00001d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001da0| 00 00 00 00 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 01 00 00 00 | 00 02 30 00 00 00 00 02 |........|..0.....|
|00001dc0| 30 00 00 00 00 02 30 00 | 00 00 01 12 00 00 00 00 |0.....0.|........|
|00001dd0| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 61 6c |This fun|ction al|
|00001de0| 6c 6f 77 73 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |lows you|r progra|
|00001df0| 6d 2c 20 61 63 74 69 6e | 67 20 61 73 20 61 20 54 |m, actin|g as a T|
|00001e00| 43 50 20 73 65 72 76 65 | 72 2c 20 74 6f 20 73 65 |CP serve|r, to se|
|00001e10| 6e 64 20 64 61 74 61 20 | 74 6f 20 61 20 63 6c 69 |nd data |to a cli|
|00001e20| 65 6e 74 2e 0a 0a 49 66 | 20 73 75 63 63 65 73 73 |ent...If| success|
|00001e30| 66 75 6c 2c 20 74 68 69 | 73 20 66 75 6e 63 74 69 |ful, thi|s functi|
|00001e40| 6f 6e 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 6e |on retur|ns the n|
|00001e50| 75 6d 62 65 72 20 6f 66 | 20 62 79 74 65 73 20 77 |umber of| bytes w|
|00001e60| 72 69 74 74 65 6e 2e 20 | 20 4f 74 68 65 72 77 69 |ritten. | Otherwi|
|00001e70| 73 65 2c 20 74 68 69 73 | 20 66 75 6e 63 74 69 6f |se, this| functio|
|00001e80| 6e 20 72 65 74 75 72 6e | 73 20 61 20 6e 65 67 61 |n return|s a nega|
|00001e90| 74 69 76 65 20 65 72 72 | 6f 72 20 63 6f 64 65 2e |tive err|or code.|
|00001ea0| 20 20 53 65 65 20 74 68 | 65 20 68 65 6c 70 20 66 | See th|e help f|
|00001eb0| 6f 72 20 74 68 65 20 53 | 74 61 74 75 73 20 63 6f |or the S|tatus co|
|00001ec0| 6e 74 72 6f 6c 20 66 6f | 72 20 74 68 65 20 65 72 |ntrol fo|r the er|
|00001ed0| 72 6f 72 20 63 6f 64 65 | 20 76 61 6c 75 65 73 2e |ror code| values.|
|00001ee0| 00 00 00 00 00 3c 00 00 | 00 00 54 68 65 20 70 6f |.....<..|..The po|
|00001ef0| 69 6e 74 65 72 20 74 6f | 20 74 68 65 20 64 61 74 |inter to| the dat|
|00001f00| 61 20 74 6f 20 62 65 20 | 77 72 74 74 65 6e 2e 20 |a to be |wrtten. |
|00001f10| 4e 55 4c 4c 20 69 73 20 | 6e 6f 74 20 61 6c 6c 6f |NULL is |not allo|
|00001f20| 77 65 64 2e 00 00 00 00 | 00 31 00 00 00 00 54 68 |wed.....|.1....Th|
|00001f30| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 62 79 74 65 |e number| of byte|
|00001f40| 73 20 69 6e 20 74 68 65 | 20 64 61 74 61 20 74 6f |s in the| data to|
|00001f50| 20 62 65 20 77 72 69 74 | 74 65 6e 2e 20 00 00 00 | be writ|ten. ...|
|00001f60| 00 0d a4 00 f4 01 92 ff | ff 00 00 06 00 00 00 00 |........|........|
|00001f70| 00 00 00 53 74 61 74 75 | 73 00 00 00 00 00 00 00 |...Statu|s.......|
|00001f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f90| 00 00 00 00 00 1a 18 00 | 4e 00 49 00 00 00 04 01 |........|N.I.....|
|00001fa0| 00 00 00 00 00 00 00 43 | 6f 6e 76 65 72 73 61 74 |.......C|onversat|
|00001fb0| 69 6f 6e 20 48 61 6e 64 | 6c 65 00 00 00 00 00 00 |ion Hand|le......|
|00001fc0| 00 00 00 00 00 00 00 00 | 00 1e e2 00 4e 00 ed 00 |........|....N...|
|00001fd0| 01 00 19 01 00 00 00 00 | 00 00 00 44 61 74 61 20 |........|...Data |
|00001fe0| 50 6f 69 6e 74 65 72 00 | 00 00 00 00 00 00 00 00 |Pointer.|........|
|00001ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 1f 26 00 |........|......&.|
|00002000| 4e 01 92 00 02 00 04 01 | 00 00 00 00 00 00 00 44 |N.......|.......D|
|00002010| 61 74 61 20 53 69 7a 65 | 00 00 00 00 00 00 00 00 |ata Size|........|
|00002020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002030| 00 1b 55 00 b2 00 49 00 | 03 00 04 01 00 00 00 00 |..U...I.|........|
|00002040| 00 00 00 54 69 6d 65 20 | 4f 75 74 00 00 00 00 00 |...Time |Out.....|
|00002050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002060| 00 00 00 00 00 00 09 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002070| 00 00 00 01 00 00 00 00 | 02 30 00 00 00 00 02 30 |........|.0.....0|
|00002080| 00 00 00 00 02 30 00 00 | 00 01 3e 00 00 00 00 54 |.....0..|..>....T|
|00002090| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 72 65 6d |his func|tion rem|
|000020a0| 6f 76 65 73 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |oves you|r progra|
|000020b0| 6d 20 66 72 6f 6d 20 69 | 74 73 20 63 61 70 61 63 |m from i|ts capac|
|000020c0| 69 74 79 20 61 73 20 61 | 20 54 43 50 20 73 65 72 |ity as a| TCP ser|
|000020d0| 76 65 72 20 75 6e 64 65 | 72 20 74 68 65 20 73 70 |ver unde|r the sp|
|000020e0| 65 63 69 66 69 65 64 20 | 70 6f 72 74 20 6e 75 6d |ecified |port num|
|000020f0| 62 65 72 2e 20 20 4e 6f | 20 66 75 72 74 68 65 72 |ber. No| further|
|00002100| 20 73 65 72 76 69 63 65 | 20 69 73 20 70 72 6f 76 | service| is prov|
|00002110| 69 64 65 64 2e 20 20 41 | 6c 6c 20 63 6f 6e 6e 65 |ided. A|ll conne|
|00002120| 63 74 69 6f 6e 73 20 77 | 69 74 68 20 63 6c 69 65 |ctions w|ith clie|
|00002130| 6e 74 73 20 61 72 65 20 | 63 6c 6f 73 65 64 2e 20 |nts are |closed. |
|00002140| 20 54 68 65 20 73 65 72 | 76 65 72 20 63 61 6c 6c | The ser|ver call|
|00002150| 62 61 63 6b 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |back fun|ction is|
|00002160| 20 6e 6f 20 6c 6f 6e 67 | 65 72 20 63 61 6c 6c 65 | no long|er calle|
|00002170| 64 20 66 6f 72 20 74 68 | 69 73 20 70 6f 72 74 20 |d for th|is port |
|00002180| 6e 75 6d 62 65 72 2e 20 | 0a 0a 49 74 20 72 65 74 |number. |..It ret|
|00002190| 75 72 6e 73 20 7a 65 72 | 6f 20 66 6f 72 20 73 75 |urns zer|o for su|
|000021a0| 63 63 65 73 73 20 6f 72 | 20 61 20 6e 65 67 61 74 |ccess or| a negat|
|000021b0| 69 76 65 20 65 72 72 6f | 72 20 63 6f 64 65 20 66 |ive erro|r code f|
|000021c0| 6f 72 20 66 61 69 6c 75 | 72 65 2e 00 00 00 00 00 |or failu|re......|
|000021d0| 4d 00 00 00 00 54 68 65 | 20 70 6f 72 74 20 6e 75 |M....The| port nu|
|000021e0| 6d 62 65 72 20 75 6e 64 | 65 72 20 77 68 69 63 68 |mber und|er which|
|000021f0| 20 79 6f 75 72 20 70 72 | 6f 67 72 61 6d 20 77 61 | your pr|ogram wa|
|00002200| 73 20 72 65 67 69 73 74 | 65 72 65 64 20 61 73 20 |s regist|ered as |
|00002210| 61 20 54 43 50 20 73 65 | 72 76 65 72 2e 20 20 0a |a TCP se|rver. .|
|00002220| 00 00 00 00 0d a4 00 f2 | 01 92 ff ff 00 00 06 00 |........|........|
|00002230| 00 00 00 00 00 00 53 74 | 61 74 75 73 00 00 00 00 |......St|atus....|
|00002240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002250| 00 00 00 00 00 00 00 00 | 21 cd 00 4c 00 4f 00 00 |........|!..L.O..|
|00002260| 00 04 01 00 00 00 00 00 | 00 00 50 6f 72 74 20 4e |........|..Port N|
|00002270| 75 6d 62 65 72 00 00 00 | 00 00 00 00 00 00 00 00 |umber...|........|
|00002280| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 09 00 00 |........|........|
|00002290| 00 00 00 00 00 00 00 00 | 00 00 02 30 00 00 00 00 |........|...0....|
|000022a0| ee 00 00 00 00 54 68 69 | 73 20 66 75 6e 63 74 69 |.....Thi|s functi|
|000022b0| 6f 6e 20 61 6c 6c 6f 77 | 73 20 61 20 54 43 50 20 |on allow|s a TCP |
|000022c0| 53 65 72 76 65 72 20 74 | 6f 20 74 65 72 6d 69 6e |Server t|o termin|
|000022d0| 61 74 65 20 61 20 63 6f | 6e 6e 65 63 74 69 6f 6e |ate a co|nnection|
|000022e0| 20 77 69 74 68 20 61 20 | 63 6c 69 65 6e 74 2e 20 | with a |client. |
|000022f0| 28 4e 6f 74 65 20 74 68 | 61 74 20 74 68 65 72 65 |(Note th|at there|
|00002300| 20 63 61 6e 20 62 65 20 | 6d 6f 72 65 20 74 68 61 | can be |more tha|
|00002310| 6e 20 6f 6e 65 20 63 6f | 6e 76 65 72 73 61 74 69 |n one co|nversati|
|00002320| 6f 6e 20 62 65 74 77 65 | 65 6e 20 61 20 73 65 72 |on betwe|en a ser|
|00002330| 76 65 72 20 61 6e 64 20 | 61 20 63 6c 69 65 6e 74 |ver and |a client|
|00002340| 2e 29 0a 0a 54 68 69 73 | 20 66 75 6e 63 74 69 6f |.)..This| functio|
|00002350| 6e 20 72 65 74 75 72 6e | 73 20 7a 65 72 6f 20 66 |n return|s zero f|
|00002360| 6f 72 20 73 75 63 63 65 | 73 73 20 6f 72 20 61 20 |or succe|ss or a |
|00002370| 6e 65 67 61 74 69 76 65 | 20 65 72 72 6f 72 20 63 |negative| error c|
|00002380| 6f 64 65 20 66 6f 72 20 | 66 61 69 6c 75 72 65 2e |ode for |failure.|
|00002390| 20 00 00 00 00 1a 18 00 | 4a 00 5f 00 00 00 04 01 | .......|J._.....|
|000023a0| 00 00 00 00 00 00 00 43 | 6f 6e 76 65 72 73 61 74 |.......C|onversat|
|000023b0| 69 6f 6e 20 48 61 6e 64 | 6c 65 00 00 00 00 00 00 |ion Hand|le......|
|000023c0| 00 00 00 00 00 00 00 00 | 00 0d a4 00 ef 01 8d ff |........|........|
|000023d0| ff 00 00 06 00 00 00 00 | 00 00 00 53 74 61 74 75 |........|...Statu|
|000023e0| 73 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.......|........|
|000023f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 01 00 |........|........|
|00002400| 00 00 00 09 00 00 00 00 | 00 00 00 00 00 00 00 01 |........|........|
|00002410| 9a 00 00 00 00 54 68 69 | 73 20 66 75 6e 63 74 69 |.....Thi|s functi|
|00002420| 6f 6e 20 65 73 74 61 62 | 6c 69 73 68 65 73 20 61 |on estab|lishes a|
|00002430| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 62 65 74 77 | connect|ion betw|
|00002440| 65 65 6e 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d |een your| program|
|00002450| 20 61 6e 64 20 61 20 54 | 43 50 20 73 65 72 76 65 | and a T|CP serve|
|00002460| 72 20 73 70 65 63 69 66 | 69 65 64 20 62 79 20 61 |r specif|ied by a|
|00002470| 20 70 6f 72 74 20 6e 75 | 6d 62 65 72 20 61 6e 64 | port nu|mber and|
|00002480| 20 73 65 72 76 65 72 20 | 68 6f 73 74 20 6e 61 6d | server |host nam|
|00002490| 65 2e 20 20 59 6f 75 72 | 20 70 72 6f 67 72 61 6d |e. Your| program|
|000024a0| 20 62 65 63 6f 6d 65 73 | 20 61 20 54 43 50 20 63 | becomes| a TCP c|
|000024b0| 6c 69 65 6e 74 2e 20 20 | 54 68 65 72 65 61 66 74 |lient. |Thereaft|
|000024c0| 65 72 2c 20 61 6c 6c 20 | 6d 65 73 73 61 67 65 73 |er, all |messages|
|000024d0| 20 66 72 6f 6d 20 74 68 | 65 20 73 65 72 76 65 72 | from th|e server|
|000024e0| 20 77 69 6c 6c 20 62 65 | 20 72 6f 75 74 65 64 20 | will be| routed |
|000024f0| 74 68 72 6f 75 67 68 20 | 74 68 65 20 73 70 65 63 |through |the spec|
|00002500| 69 66 69 65 64 20 63 6c | 69 65 6e 74 20 63 61 6c |ified cl|ient cal|
|00002510| 6c 62 61 63 6b 20 66 75 | 6e 63 74 69 6f 6e 2e 20 |lback fu|nction. |
|00002520| 0a 0a 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |..This f|unction |
|00002530| 72 65 74 75 72 6e 73 20 | 7a 65 72 6f 20 66 6f 72 |returns |zero for|
|00002540| 20 73 75 63 63 65 73 73 | 20 6f 72 20 61 20 6e 65 | success| or a ne|
|00002550| 67 61 74 69 76 65 20 65 | 72 72 6f 72 20 63 6f 64 |gative e|rror cod|
|00002560| 65 20 66 6f 72 20 66 61 | 69 6c 75 72 65 2e 20 20 |e for fa|ilure. |
|00002570| 53 65 65 20 74 68 65 20 | 68 65 6c 70 20 66 6f 72 |See the |help for|
|00002580| 20 74 68 65 20 53 74 61 | 74 75 73 20 63 6f 6e 74 | the Sta|tus cont|
|00002590| 72 6f 6c 20 66 6f 72 20 | 74 68 65 20 65 72 72 6f |rol for |the erro|
|000025a0| 72 20 63 6f 64 65 20 76 | 61 75 65 73 2e 00 00 00 |r code v|aues....|
|000025b0| 00 00 65 00 00 00 00 54 | 68 65 20 63 6f 6e 76 65 |..e....T|he conve|
|000025c0| 72 73 61 74 69 6f 6e 20 | 68 61 6e 64 6c 65 20 74 |rsation |handle t|
|000025d0| 68 61 74 20 75 6e 69 71 | 75 65 6c 79 20 72 65 70 |hat uniq|uely rep|
|000025e0| 72 65 73 65 6e 74 73 20 | 74 68 65 20 63 6f 6e 6e |resents |the conn|
|000025f0| 65 63 74 69 6f 6e 20 62 | 65 74 77 65 65 6e 20 74 |ection b|etween t|
|00002600| 68 65 20 73 65 72 76 65 | 72 20 61 6e 64 20 74 68 |he serve|r and th|
|00002610| 65 20 63 6c 69 65 6e 74 | 2e 20 00 00 00 00 00 34 |e client|. .....4|
|00002620| 00 00 00 00 54 68 65 20 | 70 6f 72 74 20 6e 75 6d |....The |port num|
|00002630| 62 65 72 20 6f 66 20 74 | 68 65 20 73 65 72 76 65 |ber of t|he serve|
|00002640| 72 20 74 6f 20 77 68 69 | 63 68 20 74 6f 20 63 6f |r to whi|ch to co|
|00002650| 6e 6e 65 63 74 2e 00 00 | 00 00 00 ff 00 00 00 00 |nnect...|........|
|00002660| 54 68 65 20 6e 61 6d 65 | 20 6f 66 20 74 68 65 20 |The name| of the |
|00002670| 68 6f 73 74 20 6d 61 63 | 68 69 6e 65 20 66 6f 72 |host mac|hine for|
|00002680| 20 74 68 65 20 73 65 72 | 76 65 72 2e 20 20 54 68 | the ser|ver. Th|
|00002690| 65 20 6e 61 6d 65 20 63 | 61 6e 20 65 69 74 68 65 |e name c|an eithe|
|000026a0| 72 20 62 65 20 61 6e 20 | 61 6c 70 68 61 62 65 74 |r be an |alphabet|
|000026b0| 69 63 61 6c 20 73 74 72 | 69 6e 67 20 28 65 2e 67 |ical str|ing (e.g|
|000026c0| 2e 2c 20 22 78 79 7a 2e | 6e 61 74 69 6e 73 74 2e |., "xyz.|natinst.|
|000026d0| 63 6f 6d 22 2c 20 6f 72 | 20 61 20 6e 75 6d 65 72 |com", or| a numer|
|000026e0| 69 63 61 6c 20 73 74 72 | 69 6e 67 20 28 65 2e 67 |ical str|ing (e.g|
|000026f0| 2e 2c 20 22 31 32 33 2e | 34 35 36 2e 37 2e 38 22 |., "123.|456.7.8"|
|00002700| 2e 29 2e 0a 0a 49 66 20 | 79 6f 75 20 70 61 73 73 |.)...If |you pass|
|00002710| 20 4e 55 4c 4c 20 6f 72 | 20 61 6e 20 65 6d 70 74 | NULL or| an empt|
|00002720| 79 20 73 74 72 69 6e 67 | 2c 20 74 68 65 20 73 65 |y string|, the se|
|00002730| 72 76 65 72 20 68 6f 73 | 74 20 69 73 20 61 73 73 |rver hos|t is ass|
|00002740| 75 6d 65 64 20 74 6f 20 | 62 65 20 74 68 65 20 6c |umed to |be the l|
|00002750| 6f 63 61 6c 20 6d 61 63 | 68 69 6e 65 2e 00 00 00 |ocal mac|hine....|
|00002760| 00 05 c4 00 00 00 00 54 | 68 65 20 6e 61 6d 65 20 |.......T|he name |
|00002770| 6f 66 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |of the f|unction |
|00002780| 74 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 74 6f 20 |to be ca|lled to |
|00002790| 70 72 6f 63 65 73 73 20 | 6d 65 73 73 61 67 65 73 |process |messages|
|000027a0| 20 74 6f 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d | to your| program|
|000027b0| 20 61 73 20 61 20 54 43 | 50 20 63 6c 69 65 6e 74 | as a TC|P client|
|000027c0| 2e 20 20 41 20 4e 55 4c | 4c 20 70 6f 69 6e 74 65 |. A NUL|L pointe|
|000027d0| 72 20 69 73 20 6e 6f 74 | 20 61 6c 6c 6f 77 65 64 |r is not| allowed|
|000027e0| 2e 20 0a 0a 54 68 65 20 | 63 61 6c 6c 62 61 63 6b |. ..The |callback|
|000027f0| 20 66 75 6e 63 74 69 6f | 6e 20 6d 75 73 74 20 62 | functio|n must b|
|00002800| 65 20 6f 66 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |e of the| followi|
|00002810| 6e 67 20 66 6f 72 6d 3a | 0a 0a 20 20 20 20 69 6e |ng form:|.. in|
|00002820| 74 20 28 2a 74 63 70 46 | 75 6e 63 50 74 72 29 20 |t (*tcpF|uncPtr) |
|00002830| 28 75 6e 73 69 67 6e 65 | 64 20 68 61 6e 64 6c 65 |(unsigne|d handle|
|00002840| 2c 20 69 6e 74 20 78 54 | 79 70 65 2c 20 69 6e 74 |, int xT|ype, int|
|00002850| 20 65 72 72 43 6f 64 65 | 2c 20 0a 20 20 20 20 20 | errCode|, . |
|00002860| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002870| 20 20 76 6f 69 64 20 2a | 63 61 6c 6c 62 61 63 6b | void *|callback|
|00002880| 44 61 74 61 29 3b 0a 20 | 0a 54 68 65 20 27 68 61 |Data);. |.The 'ha|
|00002890| 6e 64 6c 65 27 20 70 61 | 72 61 6d 65 74 65 72 20 |ndle' pa|rameter |
|000028a0| 63 6f 6e 74 61 69 6e 73 | 20 61 20 76 61 6c 75 65 |contains| a value|
|000028b0| 20 74 68 61 74 20 69 73 | 20 75 6e 69 71 75 65 20 | that is| unique |
|000028c0| 74 6f 20 65 61 63 68 20 | 63 6c 69 65 6e 74 2d 73 |to each |client-s|
|000028d0| 65 72 76 65 72 20 63 6f | 6e 6e 65 63 74 69 6f 6e |erver co|nnection|
|000028e0| 2e 0a 0a 54 68 65 20 27 | 78 54 79 70 65 27 20 70 |...The '|xType' p|
|000028f0| 61 72 61 6d 65 74 65 72 | 20 63 6f 6e 74 61 69 6e |arameter| contain|
|00002900| 73 20 74 68 65 20 54 43 | 50 20 74 72 61 6e 73 61 |s the TC|P transa|
|00002910| 63 74 69 6f 6e 20 74 79 | 70 65 2e 20 20 54 68 65 |ction ty|pe. The|
|00002920| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6c 69 73 74 20 | followi|ng list |
|00002930| 73 70 65 63 69 66 69 65 | 73 20 61 6c 6c 20 6f 66 |specifie|s all of|
|00002940| 20 74 68 65 20 74 72 61 | 6e 73 61 63 74 69 6f 6e | the tra|nsaction|
|00002950| 20 74 79 70 65 73 20 74 | 68 61 74 20 63 61 6e 20 | types t|hat can |
|00002960| 62 65 20 72 65 63 65 69 | 76 65 64 20 62 79 20 63 |be recei|ved by c|
|00002970| 6c 69 65 6e 74 73 3a 0a | 0a 20 20 54 43 50 5f 44 |lients:.|. TCP_D|
|00002980| 49 53 43 4f 4e 4e 45 43 | 54 20 20 20 20 20 20 20 |ISCONNEC|T |
|00002990| 20 20 20 0a 20 20 54 43 | 50 5f 44 41 54 41 52 45 | . TC|P_DATARE|
|000029a0| 41 44 59 20 20 20 20 20 | 20 20 20 20 20 20 0a 0a |ADY | ..|
|000029b0| 54 68 65 20 27 65 72 72 | 43 6f 64 65 27 20 70 61 |The 'err|Code' pa|
|000029c0| 72 61 6d 65 74 65 72 20 | 69 73 20 75 73 65 64 20 |rameter |is used |
|000029d0| 6f 6e 6c 79 20 77 68 65 | 6e 20 74 68 65 20 74 72 |only whe|n the tr|
|000029e0| 61 6e 73 61 63 74 69 6f | 6e 20 74 79 70 65 20 69 |ansactio|n type i|
|000029f0| 73 20 54 43 50 5f 44 49 | 53 43 4f 4e 4e 45 43 54 |s TCP_DI|SCONNECT|
|00002a00| 2e 0a 0a 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |...The f|ollowing|
|00002a10| 20 64 65 73 63 72 69 62 | 65 73 20 65 61 63 68 20 | describ|es each |
|00002a20| 74 72 61 6e 73 61 63 74 | 69 6f 6e 20 74 79 70 65 |transact|ion type|
|00002a30| 2e 0a 0a 54 43 50 5f 44 | 49 53 43 4f 4e 4e 45 43 |...TCP_D|ISCONNEC|
|00002a40| 54 20 2d 20 52 65 63 65 | 69 76 65 64 20 77 68 65 |T - Rece|ived whe|
|00002a50| 6e 20 61 20 73 65 72 76 | 65 72 20 69 73 20 72 65 |n a serv|er is re|
|00002a60| 71 75 65 73 74 69 6e 67 | 20 74 68 65 20 74 65 72 |questing| the ter|
|00002a70| 6d 69 6e 61 74 69 6f 6e | 20 6f 66 20 61 20 63 6f |mination| of a co|
|00002a80| 6e 6e 65 63 74 69 6f 6e | 2c 20 6f 72 20 77 68 65 |nnection|, or whe|
|00002a90| 6e 20 61 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 69 |n a conn|ection i|
|00002aa0| 73 20 62 65 69 6e 67 20 | 74 65 72 6d 69 6e 61 74 |s being |terminat|
|00002ab0| 65 64 20 64 75 65 20 74 | 6f 20 61 6e 20 65 72 72 |ed due t|o an err|
|00002ac0| 6f 72 2e 20 20 49 66 20 | 74 68 65 20 63 6f 6e 6e |or. If |the conn|
|00002ad0| 65 63 74 69 6f 6e 20 69 | 73 20 62 65 69 6e 67 20 |ection i|s being |
|00002ae0| 74 65 72 6d 69 6e 61 74 | 65 64 20 64 75 65 20 74 |terminat|ed due t|
|00002af0| 6f 20 61 6e 20 65 72 72 | 6f 72 2c 20 74 68 65 20 |o an err|or, the |
|00002b00| 27 65 72 72 43 6f 64 65 | 27 20 70 61 72 61 6d 65 |'errCode|' parame|
|00002b10| 74 65 72 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 6e |ter cont|ains a n|
|00002b20| 65 67 61 74 69 76 65 20 | 65 72 72 6f 72 20 63 6f |egative |error co|
|00002b30| 64 65 2e 20 20 4f 74 68 | 65 72 77 69 73 65 20 74 |de. Oth|erwise t|
|00002b40| 68 65 20 27 65 72 72 43 | 6f 64 65 27 20 70 61 72 |he 'errC|ode' par|
|00002b50| 61 6d 65 74 65 72 20 63 | 6f 6e 74 61 69 6e 73 20 |ameter c|ontains |
|00002b60| 7a 65 72 6f 2e 20 20 28 | 53 65 65 20 74 68 65 20 |zero. (|See the |
|00002b70| 68 65 6c 70 20 66 6f 72 | 20 74 68 65 20 53 74 61 |help for| the Sta|
|00002b80| 74 75 73 20 63 6f 6e 74 | 72 6f 6c 20 66 6f 72 20 |tus cont|rol for |
|00002b90| 74 68 65 20 6c 69 73 74 | 20 6f 66 20 65 72 72 6f |the list| of erro|
|00002ba0| 72 20 63 6f 64 65 20 76 | 61 6c 75 65 73 2e 29 0a |r code v|alues.).|
|00002bb0| 0a 54 43 50 5f 44 41 54 | 41 52 45 41 44 59 20 2d |.TCP_DAT|AREADY -|
|00002bc0| 20 52 65 63 65 69 76 65 | 64 20 77 68 65 6e 20 74 | Receive|d when t|
|00002bd0| 68 65 20 73 65 72 76 65 | 72 20 68 61 73 20 73 65 |he serve|r has se|
|00002be0| 6e 74 20 64 61 74 61 20 | 76 69 61 20 54 43 50 20 |nt data |via TCP |
|00002bf0| 74 6f 20 74 68 65 20 63 | 6c 69 65 6e 74 2e 20 20 |to the c|lient. |
|00002c00| 59 6f 75 72 20 70 72 6f | 67 72 61 6d 2c 20 61 63 |Your pro|gram, ac|
|00002c10| 74 69 6e 67 20 61 73 20 | 74 68 65 20 63 6c 69 65 |ting as |the clie|
|00002c20| 6e 74 2c 20 73 68 6f 75 | 6c 64 20 63 61 6c 6c 20 |nt, shou|ld call |
|00002c30| 0a 43 6c 69 65 6e 74 54 | 43 50 52 65 61 64 20 74 |.ClientT|CPRead t|
|00002c40| 6f 20 6f 62 74 61 69 6e | 20 74 68 65 20 64 61 74 |o obtain| the dat|
|00002c50| 61 2e 0a 0a 52 65 6d 61 | 72 6b 73 3a 0a 2d 2d 2d |a...Rema|rks:.---|
|00002c60| 2d 2d 2d 2d 2d 0a 54 68 | 65 20 63 61 6c 6c 62 61 |-----.Th|e callba|
|00002c70| 63 6b 20 66 75 6e 63 74 | 69 6f 6e 20 73 68 6f 75 |ck funct|ion shou|
|00002c80| 6c 64 20 72 65 74 75 72 | 6e 20 54 52 55 45 20 69 |ld retur|n TRUE i|
|00002c90| 66 20 74 68 65 20 6d 65 | 73 73 61 67 65 20 63 61 |f the me|ssage ca|
|00002ca0| 6e 20 62 65 20 70 72 6f | 63 65 73 73 65 64 20 73 |n be pro|cessed s|
|00002cb0| 75 63 63 65 73 73 66 75 | 6c 6c 79 2e 20 20 4f 74 |uccessfu|lly. Ot|
|00002cc0| 68 65 72 77 69 73 65 2c | 20 69 74 20 73 68 6f 75 |herwise,| it shou|
|00002cd0| 6c 64 20 72 65 74 75 72 | 6e 20 46 41 4c 53 45 2e |ld retur|n FALSE.|
|00002ce0| 20 20 0a 0a 54 68 65 20 | 63 61 6c 6c 62 61 63 6b | ..The |callback|
|00002cf0| 20 66 75 6e 63 74 69 6f | 6e 20 73 68 6f 75 6c 64 | functio|n should|
|00002d00| 20 62 65 20 73 68 6f 72 | 74 20 61 6e 64 20 72 65 | be shor|t and re|
|00002d10| 74 75 72 6e 20 61 73 20 | 73 6f 6f 6e 20 61 73 20 |turn as |soon as |
|00002d20| 70 6f 73 73 69 62 6c 65 | 2e 00 00 00 00 01 b7 00 |possible|........|
|00002d30| 00 00 00 41 20 66 6f 75 | 72 2d 62 79 74 65 20 76 |...A fou|r-byte v|
|00002d40| 61 6c 75 65 20 74 68 61 | 74 20 77 69 6c 6c 20 62 |alue tha|t will b|
|00002d50| 65 20 70 61 73 73 65 64 | 20 74 6f 20 74 68 65 20 |e passed| to the |
|00002d60| 63 61 6c 6c 62 61 63 6b | 20 66 75 6e 63 74 69 6f |callback| functio|
|00002d70| 6e 20 65 61 63 68 20 74 | 69 6d 65 20 69 74 20 69 |n each t|ime it i|
|00002d80| 73 20 63 61 6c 6c 65 64 | 20 66 6f 72 20 74 68 65 |s called| for the|
|00002d90| 20 74 68 69 73 20 63 6c | 69 65 6e 74 2e 0a 0a 49 | this cl|ient...I|
|00002da0| 74 20 69 73 20 75 70 20 | 74 6f 20 79 6f 75 20 74 |t is up |to you t|
|00002db0| 6f 20 64 65 66 69 6e 65 | 20 74 68 65 20 6d 65 61 |o define| the mea|
|00002dc0| 6e 69 6e 67 20 6f 66 20 | 74 68 65 20 63 61 6c 6c |ning of |the call|
|00002dd0| 62 61 63 6b 20 64 61 74 | 61 2e 20 20 0a 4f 6e 65 |back dat|a. .One|
|00002de0| 20 77 61 79 20 74 6f 20 | 75 73 65 20 74 68 65 20 | way to |use the |
|00002df0| 63 61 6c 6c 62 61 63 6b | 20 64 61 74 61 20 69 73 |callback| data is|
|00002e00| 20 61 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f | as a po|inter to|
|00002e10| 20 61 20 64 61 74 61 20 | 0a 6f 62 6a 65 63 74 20 | a data |.object |
|00002e20| 74 68 61 74 20 79 6f 75 | 20 6e 65 65 64 20 74 6f |that you| need to|
|00002e30| 20 61 63 63 65 73 73 20 | 69 6e 20 74 68 65 20 63 | access |in the c|
|00002e40| 61 6c 6c 62 61 63 6b 20 | 66 75 6e 63 74 69 6f 6e |allback |function|
|00002e50| 2e 20 20 49 6e 20 20 20 | 20 20 20 0a 74 68 69 73 |. In | .this|
|00002e60| 20 77 61 79 2c 20 79 6f | 75 20 77 6f 75 6c 64 20 | way, yo|u would |
|00002e70| 6e 6f 74 20 6e 65 65 64 | 20 74 6f 20 64 65 63 6c |not need| to decl|
|00002e80| 61 72 65 20 74 68 65 20 | 64 61 74 61 20 6f 62 6a |are the |data obj|
|00002e90| 65 63 74 20 61 73 20 61 | 20 67 6c 6f 62 61 6c 20 |ect as a| global |
|00002ea0| 76 61 72 69 61 62 6c 65 | 2e 0a 0a 49 66 20 79 6f |variable|...If yo|
|00002eb0| 75 20 64 6f 20 6e 6f 74 | 20 77 61 6e 74 20 74 6f |u do not| want to|
|00002ec0| 20 75 73 65 20 74 68 65 | 20 63 61 6c 6c 62 61 63 | use the| callbac|
|00002ed0| 6b 20 64 61 74 61 2c 20 | 79 6f 75 20 63 61 6e 20 |k data, |you can |
|00002ee0| 70 61 73 73 20 30 2e 20 | 00 00 00 00 02 01 00 00 |pass 0. |........|
|00002ef0| 00 00 54 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |..The nu|mber of |
|00002f00| 6d 69 6c 6c 69 73 65 63 | 6f 6e 64 73 20 74 6f 20 |millisec|onds to |
|00002f10| 77 61 69 74 20 62 65 66 | 6f 72 65 20 72 65 74 75 |wait bef|ore retu|
|00002f20| 72 6e 69 6e 67 2e 20 20 | 46 6f 72 20 69 6e 73 74 |rning. |For inst|
|00002f30| 61 6e 63 65 2c 20 69 66 | 20 61 20 76 61 6c 75 65 |ance, if| a value|
|00002f40| 20 6f 66 20 31 30 30 20 | 69 73 20 70 61 73 73 65 | of 100 |is passe|
|00002f50| 64 2c 20 74 68 65 6e 20 | 74 68 65 20 66 75 6e 63 |d, then |the func|
|00002f60| 74 69 6f 6e 20 77 69 6c | 6c 20 72 65 74 75 72 6e |tion wil|l return|
|00002f70| 20 61 6e 20 65 72 72 6f | 72 20 69 66 20 31 30 30 | an erro|r if 100|
|00002f80| 20 6d 69 6c 6c 69 73 65 | 63 6f 6e 64 73 20 70 61 | millise|conds pa|
|00002f90| 73 73 65 73 20 77 69 74 | 68 6f 75 74 20 74 68 65 |sses wit|hout the|
|00002fa0| 20 63 6f 6e 6e 65 63 74 | 69 6f 6e 20 62 65 69 6e | connect|ion bein|
|00002fb0| 67 20 65 73 74 61 62 6c | 69 73 68 65 64 2e 0a 0a |g establ|ished...|
|00002fc0| 49 66 20 61 20 76 61 6c | 75 65 20 6f 66 20 7a 65 |If a val|ue of ze|
|00002fd0| 72 6f 20 69 73 20 70 61 | 73 73 65 64 2c 20 74 68 |ro is pa|ssed, th|
|00002fe0| 65 6e 20 61 20 64 65 66 | 61 75 6c 74 20 74 69 6d |en a def|ault tim|
|00002ff0| 65 6f 75 74 20 6f 66 20 | 35 30 30 30 20 6d 69 6c |eout of |5000 mil|
|00003000| 6c 69 73 65 63 6f 6e 64 | 73 20 69 73 20 75 73 65 |lisecond|s is use|
|00003010| 64 2e 0a 0a 4e 4f 54 45 | 3a 20 54 68 65 20 68 6f |d...NOTE|: The ho|
|00003020| 73 74 20 6e 61 6d 65 20 | 6c 6f 6f 6b 75 70 20 28 |st name |lookup (|
|00003030| 69 66 20 6e 65 65 64 65 | 64 29 20 69 73 20 70 65 |if neede|d) is pe|
|00003040| 72 66 6f 72 6d 65 64 20 | 62 65 66 6f 72 65 20 73 |rformed |before s|
|00003050| 74 61 72 74 69 6e 67 20 | 74 68 65 20 74 69 6d 65 |tarting |the time|
|00003060| 6f 75 74 20 63 6f 75 6e | 74 64 6f 77 6e 2e 20 20 |out coun|tdown. |
|00003070| 46 6f 72 20 69 6e 73 74 | 61 6e 63 65 2c 20 69 66 |For inst|ance, if|
|00003080| 20 61 20 76 61 6c 75 65 | 20 6f 66 20 31 30 30 20 | a value| of 100 |
|00003090| 69 73 20 70 61 73 73 65 | 64 2c 20 61 6e 64 20 74 |is passe|d, and t|
|000030a0| 68 65 20 68 6f 73 74 6e | 61 6d 65 20 6c 6f 6f 6b |he hostn|ame look|
|000030b0| 75 70 20 74 61 6b 65 73 | 20 35 30 20 6d 73 2c 20 |up takes| 50 ms, |
|000030c0| 74 68 65 6e 20 74 68 65 | 20 66 75 6e 63 74 69 6f |then the| functio|
|000030d0| 6e 20 6d 61 79 20 6e 6f | 74 20 72 65 74 75 72 6e |n may no|t return|
|000030e0| 20 66 6f 72 20 75 70 74 | 6f 20 31 35 30 20 6d 73 | for upt|o 150 ms|
|000030f0| 2e 00 00 00 00 0d a4 00 | f6 01 97 ff ff 00 00 06 |........|........|
|00003100| 00 00 00 00 00 00 00 53 | 74 61 74 75 73 00 00 00 |.......S|tatus...|
|00003110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003120| 00 00 00 00 00 00 00 00 | 00 25 af 00 4b 00 49 00 |........|.%..K.I.|
|00003130| 00 00 04 02 00 00 00 00 | 00 00 00 43 6f 6e 76 65 |........|...Conve|
|00003140| 72 73 61 74 69 6f 6e 20 | 48 61 6e 64 6c 65 00 00 |rsation |Handle..|
|00003150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 26 1c 00 |........|.....&..|
|00003160| 4b 00 ed 00 01 00 04 01 | 00 00 00 00 00 00 00 50 |K.......|.......P|
|00003170| 6f 72 74 20 4e 75 6d 62 | 65 72 00 00 00 00 00 00 |ort Numb|er......|
|00003180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003190| 00 26 58 00 4b 01 92 00 | 02 00 0b 01 00 00 00 00 |.&X.K...|........|
|000031a0| 00 00 00 53 65 72 76 65 | 72 20 48 6f 73 74 20 4e |...Serve|r Host N|
|000031b0| 61 6d 65 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |ame.....|........|
|000031c0| 00 00 00 00 00 27 5f 00 | b3 00 48 00 03 03 e8 01 |.....'_.|..H.....|
|000031d0| 00 00 00 00 00 00 00 43 | 61 6c 6c 62 61 63 6b 20 |.......C|allback |
|000031e0| 46 75 6e 63 74 69 6f 6e | 00 00 00 00 00 00 00 00 |Function|........|
|000031f0| 00 00 00 00 00 00 00 00 | 00 2d 2b 00 b3 00 ea 00 |........|.-+.....|
|00003200| 04 00 16 01 00 00 00 00 | 00 00 00 43 61 6c 6c 62 |........|...Callb|
|00003210| 61 63 6b 20 44 61 74 61 | 00 00 00 00 00 00 00 00 |ack Data|........|
|00003220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 2e ea 00 |........|........|
|00003230| b3 01 8d 00 05 00 04 01 | 00 00 00 00 00 00 00 54 |........|.......T|
|00003240| 69 6d 65 20 4f 75 74 00 | 00 00 00 00 00 00 00 00 |ime Out.|........|
|00003250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003260| 00 00 09 00 00 00 00 00 | 00 00 00 00 00 00 00 09 |........|........|
|00003270| 00 00 00 00 00 00 00 00 | 00 00 00 00 02 30 00 00 |........|.....0..|
|00003280| 00 00 03 22 22 00 00 00 | 00 01 00 00 00 00 02 30 |...""...|.......0|
|00003290| 00 00 00 00 02 30 00 00 | 00 01 6b 00 00 00 00 54 |.....0..|..k....T|
|000032a0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 61 6c 6c |his func|tion all|
|000032b0| 6f 77 73 20 79 6f 75 72 | 20 70 72 6f 67 72 61 6d |ows your| program|
|000032c0| 2c 20 61 63 74 69 6e 67 | 20 61 73 20 61 20 54 43 |, acting| as a TC|
|000032d0| 50 20 63 6c 69 65 6e 74 | 2c 20 74 6f 20 72 65 71 |P client|, to req|
|000032e0| 75 65 73 74 20 64 61 74 | 61 20 66 72 6f 6d 20 74 |uest dat|a from t|
|000032f0| 68 65 20 73 65 72 76 65 | 72 2e 20 20 54 68 65 20 |he serve|r. The |
|00003300| 66 75 6e 63 74 69 6f 6e | 20 77 61 69 74 73 20 75 |function| waits u|
|00003310| 6e 74 69 6c 20 74 68 65 | 20 64 61 74 61 20 69 73 |ntil the| data is|
|00003320| 20 72 65 63 65 69 76 65 | 64 20 6f 72 20 72 65 74 | receive|d or ret|
|00003330| 75 72 6e 73 20 77 68 65 | 6e 20 74 69 6d 65 20 6f |urns whe|n time o|
|00003340| 75 74 20 68 61 73 20 65 | 78 70 69 72 65 64 2e 0a |ut has e|xpired..|
|00003350| 0a 49 66 20 73 75 63 63 | 65 73 73 66 75 6c 2c 20 |.If succ|essful, |
|00003360| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 72 65 |this fun|ction re|
|00003370| 74 75 72 6e 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |turns th|e number|
|00003380| 20 6f 66 20 62 79 74 65 | 73 20 72 65 61 64 2e 20 | of byte|s read. |
|00003390| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 74 68 69 73 | Otherwi|se, this|
|000033a0| 20 66 75 6e 63 74 69 6f | 6e 20 72 65 74 75 72 6e | functio|n return|
|000033b0| 73 20 61 20 6e 65 67 61 | 74 69 76 65 20 65 72 72 |s a nega|tive err|
|000033c0| 6f 72 20 63 6f 64 65 2e | 20 20 53 65 65 20 74 68 |or code.| See th|
|000033d0| 65 20 68 65 6c 70 20 66 | 6f 72 20 74 68 65 20 53 |e help f|or the S|
|000033e0| 74 61 74 75 73 20 63 6f | 6e 74 72 6f 6c 20 66 6f |tatus co|ntrol fo|
|000033f0| 72 20 74 68 65 20 65 72 | 72 6f 72 20 63 6f 64 65 |r the er|ror code|
|00003400| 20 76 61 6c 75 65 73 2e | 00 00 00 00 00 52 00 00 | values.|.....R..|
|00003410| 00 00 54 68 65 20 70 6f | 69 6e 74 65 72 20 74 6f |..The po|inter to|
|00003420| 20 74 68 65 20 62 75 66 | 66 65 72 20 77 68 65 72 | the buf|fer wher|
|00003430| 65 20 74 68 65 20 64 61 | 74 61 20 69 73 20 74 6f |e the da|ta is to|
|00003440| 20 62 65 20 73 74 6f 72 | 65 64 2e 20 0a 0a 4e 55 | be stor|ed. ..NU|
|00003450| 4c 4c 20 69 73 20 6e 6f | 74 20 61 6c 6c 6f 77 65 |LL is no|t allowe|
|00003460| 64 2e 00 00 00 00 00 6d | 00 00 00 00 54 68 65 20 |d......m|....The |
|00003470| 6d 61 78 69 6d 75 6d 20 | 6e 75 6d 62 65 72 20 6f |maximum |number o|
|00003480| 66 20 62 79 74 65 73 20 | 74 6f 20 62 65 20 72 65 |f bytes |to be re|
|00003490| 61 64 2e 20 20 54 68 69 | 73 20 73 68 6f 75 6c 64 |ad. Thi|s should|
|000034a0| 20 62 65 20 6c 65 73 73 | 20 74 68 61 6e 20 6f 72 | be less| than or|
|000034b0| 20 65 71 75 61 6c 20 74 | 6f 20 74 68 65 20 73 69 | equal t|o the si|
|000034c0| 7a 65 20 6f 66 20 74 68 | 65 20 64 61 74 61 20 62 |ze of th|e data b|
|000034d0| 75 66 66 65 72 2e 20 00 | 00 00 00 0d a4 00 f5 01 |uffer. .|........|
|000034e0| 8d ff ff 00 00 06 00 00 | 00 00 00 00 00 53 74 61 |........|.....Sta|
|000034f0| 74 75 73 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |tus.....|........|
|00003500| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 1a |........|........|
|00003510| 18 00 4b 00 49 00 00 00 | 04 01 00 00 00 00 00 00 |..K.I...|........|
|00003520| 00 43 6f 6e 76 65 72 73 | 61 74 69 6f 6e 20 48 61 |.Convers|ation Ha|
|00003530| 6e 64 6c 65 00 00 00 00 | 00 00 00 00 00 00 00 00 |ndle....|........|
|00003540| 00 00 00 34 0a 00 4b 00 | ea 00 01 00 19 01 00 00 |...4..K.|........|
|00003550| 00 00 00 00 00 44 61 74 | 61 20 42 75 66 66 65 72 |.....Dat|a Buffer|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 00 00 00 00 00 34 | 64 00 4b 01 8c 00 02 00 |.......4|d.K.....|
|00003580| 04 01 00 00 00 00 00 00 | 00 44 61 74 61 20 53 69 |........|.Data Si|
|00003590| 7a 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |ze......|........|
|000035a0| 00 00 00 00 00 00 00 00 | 00 00 00 1b 55 00 aa 00 |........|....U...|
|000035b0| 46 00 03 00 04 01 00 00 | 00 00 00 00 00 54 69 6d |F.......|.....Tim|
|000035c0| 65 20 4f 75 74 00 00 00 | 00 00 00 00 00 00 00 00 |e Out...|........|
|000035d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000035e0| 09 00 00 00 00 00 00 00 | 00 00 00 00 00 01 00 00 |........|........|
|000035f0| 00 00 02 30 00 00 00 00 | 02 30 00 00 00 00 02 30 |...0....|.0.....0|
|00003600| 00 00 00 01 11 00 00 00 | 00 54 68 69 73 20 66 75 |........|.This fu|
|00003610| 6e 63 74 69 6f 6e 20 61 | 6c 6c 6f 77 73 20 79 6f |nction a|llows yo|
|00003620| 75 72 20 70 72 6f 67 72 | 61 6d 2c 20 61 63 74 69 |ur progr|am, acti|
|00003630| 6e 67 20 61 73 20 61 20 | 54 43 50 20 63 6c 69 65 |ng as a |TCP clie|
|00003640| 6e 74 2c 20 74 6f 20 73 | 65 6e 64 20 64 61 74 61 |nt, to s|end data|
|00003650| 20 74 6f 20 74 68 65 20 | 73 65 72 76 65 72 2e 0a | to the |server..|
|00003660| 0a 49 66 20 73 75 63 63 | 65 73 73 66 75 6c 2c 20 |.If succ|essful, |
|00003670| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 72 65 |this fun|ction re|
|00003680| 74 75 72 6e 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |turns th|e number|
|00003690| 20 6f 66 20 62 79 74 65 | 73 20 73 65 6e 74 2e 20 | of byte|s sent. |
|000036a0| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 74 68 69 73 | Otherwi|se, this|
|000036b0| 20 66 75 6e 63 74 69 6f | 6e 20 72 65 74 75 72 6e | functio|n return|
|000036c0| 73 20 61 20 6e 65 67 61 | 74 69 76 65 20 65 72 72 |s a nega|tive err|
|000036d0| 6f 72 20 63 6f 64 65 2e | 20 20 53 65 65 20 74 68 |or code.| See th|
|000036e0| 65 20 68 65 6c 70 20 66 | 6f 72 20 74 68 65 20 53 |e help f|or the S|
|000036f0| 74 61 74 75 73 20 63 6f | 6e 74 72 6f 6c 20 66 6f |tatus co|ntrol fo|
|00003700| 72 20 74 68 65 20 65 72 | 72 6f 72 20 63 6f 64 65 |r the er|ror code|
|00003710| 20 76 61 6c 75 65 73 2e | 00 00 00 00 00 3c 00 00 | values.|.....<..|
|00003720| 00 00 54 68 65 20 70 6f | 69 6e 74 65 72 20 74 6f |..The po|inter to|
|00003730| 20 74 68 65 20 64 61 74 | 61 20 74 6f 20 62 65 20 | the dat|a to be |
|00003740| 77 72 74 74 65 6e 2e 20 | 4e 55 4c 4c 20 69 73 20 |wrtten. |NULL is |
|00003750| 6e 6f 74 20 61 6c 6c 6f | 77 65 64 2e 00 00 00 00 |not allo|wed.....|
|00003760| 00 31 00 00 00 00 54 68 | 65 20 6e 75 6d 62 65 72 |.1....Th|e number|
|00003770| 20 6f 66 20 62 79 74 65 | 73 20 69 6e 20 74 68 65 | of byte|s in the|
|00003780| 20 64 61 74 61 20 74 6f | 20 62 65 20 77 72 69 74 | data to| be writ|
|00003790| 74 65 6e 2e 20 00 00 00 | 00 0d a4 00 f6 01 8e ff |ten. ...|........|
|000037a0| ff 00 00 06 00 00 00 00 | 00 00 00 53 74 61 74 75 |........|...Statu|
|000037b0| 73 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.......|........|
|000037c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 1a 18 00 |........|........|
|000037d0| 4b 00 49 00 00 00 04 01 | 00 00 00 00 00 00 00 43 |K.I.....|.......C|
|000037e0| 6f 6e 76 65 72 73 61 74 | 69 6f 6e 20 48 61 6e 64 |onversat|ion Hand|
|000037f0| 6c 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |le......|........|
|00003800| 00 37 1a 00 4b 00 ea 00 | 01 00 19 01 00 00 00 00 |.7..K...|........|
|00003810| 00 00 00 44 61 74 61 20 | 50 6f 69 6e 74 65 72 00 |...Data |Pointer.|
|00003820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003830| 00 00 00 00 00 37 5e 00 | 4b 01 8c 00 02 00 04 01 |.....7^.|K.......|
|00003840| 00 00 00 00 00 00 00 44 | 61 74 61 20 53 69 7a 65 |.......D|ata Size|
|00003850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003860| 00 00 00 00 00 00 00 00 | 00 1b 55 00 a9 00 49 00 |........|..U...I.|
|00003870| 03 00 04 01 00 00 00 00 | 00 00 00 54 69 6d 65 20 |........|...Time |
|00003880| 4f 75 74 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Out.....|........|
|00003890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 09 00 |........|........|
|000038a0| 00 00 00 00 00 00 00 00 | 00 00 00 01 00 00 00 00 |........|........|
|000038b0| 02 30 00 00 00 00 02 30 | 00 00 00 00 02 30 00 00 |.0.....0|.....0..|
|000038c0| 00 00 ed 00 00 00 00 54 | 68 69 73 20 66 75 6e 63 |.......T|his func|
|000038d0| 74 69 6f 6e 20 74 65 72 | 6d 69 6e 61 74 65 73 20 |tion ter|minates |
|000038e0| 61 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 20 62 65 74 |a connec|tion bet|
|000038f0| 77 65 65 6e 20 74 68 65 | 20 63 6c 69 65 6e 74 20 |ween the| client |
|00003900| 61 6e 64 20 74 68 65 20 | 20 73 65 72 76 65 72 2e |and the | server.|
|00003910| 20 28 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 72 | (Note t|hat ther|
|00003920| 65 20 63 61 6e 20 62 65 | 20 6d 6f 72 65 20 74 68 |e can be| more th|
|00003930| 61 6e 20 6f 6e 65 20 63 | 6f 6e 76 65 72 73 61 74 |an one c|onversat|
|00003940| 69 6f 6e 20 62 65 74 77 | 65 65 6e 20 61 20 63 6c |ion betw|een a cl|
|00003950| 69 65 6e 74 20 61 6e 64 | 20 61 20 73 65 72 76 65 |ient and| a serve|
|00003960| 72 2e 29 0a 0a 54 68 69 | 73 20 66 75 6e 63 74 69 |r.)..Thi|s functi|
|00003970| 6f 6e 20 72 65 74 75 72 | 6e 73 20 7a 65 72 6f 20 |on retur|ns zero |
|00003980| 66 6f 72 20 73 75 63 63 | 65 73 73 20 6f 72 20 61 |for succ|ess or a|
|00003990| 20 6e 65 67 61 74 69 76 | 65 20 65 72 72 6f 72 20 | negativ|e error |
|000039a0| 63 6f 64 65 20 66 6f 72 | 20 66 61 69 6c 75 72 65 |code for| failure|
|000039b0| 2e 20 00 00 00 00 0d a4 | 00 f6 01 93 ff ff 00 00 |. ......|........|
|000039c0| 06 00 00 00 00 00 00 00 | 53 74 61 74 75 73 00 00 |........|Status..|
|000039d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000039e0| 00 00 00 00 00 00 00 00 | 00 00 1a 18 00 51 00 65 |........|.....Q.e|
|000039f0| 00 00 00 04 01 00 00 00 | 00 00 00 00 43 6f 6e 76 |........|....Conv|
|00003a00| 65 72 73 61 74 69 6f 6e | 20 48 61 6e 64 6c 65 00 |ersation| Handle.|
|00003a10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 09 |........|........|
|00003a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|00003a30| 00 6e 00 00 00 00 54 68 | 69 73 20 66 75 6e 63 74 |.n....Th|is funct|
|00003a40| 69 6f 6e 20 63 6f 6e 76 | 65 72 74 73 20 74 68 65 |ion conv|erts the|
|00003a50| 20 65 72 72 6f 72 20 6e | 75 6d 62 65 72 20 72 65 | error n|umber re|
|00003a60| 74 75 72 6e 65 64 20 62 | 79 20 61 20 54 43 50 20 |turned b|y a TCP |
|00003a70| 4c 69 62 72 61 72 79 20 | 66 75 6e 63 74 69 6f 6e |Library |function|
|00003a80| 20 69 6e 74 6f 20 61 20 | 6d 65 61 6e 69 6e 67 66 | into a |meaningf|
|00003a90| 75 6c 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |ul error| message|
|00003aa0| 2e 0a 00 00 00 00 00 35 | 00 00 00 00 41 6e 20 65 |.......5|....An e|
|00003ab0| 72 72 6f 72 20 6e 75 6d | 62 65 72 20 72 65 74 75 |rror num|ber retu|
|00003ac0| 72 6e 65 64 20 62 79 20 | 61 20 54 43 50 20 4c 69 |rned by |a TCP Li|
|00003ad0| 62 72 61 72 79 20 66 75 | 6e 63 74 69 6f 6e 2e 00 |brary fu|nction..|
|00003ae0| 00 00 00 00 34 00 00 00 | 00 54 68 65 20 6d 65 61 |....4...|.The mea|
|00003af0| 6e 69 6e 67 66 75 6c 20 | 65 72 72 6f 72 20 6d 65 |ningful |error me|
|00003b00| 73 73 61 67 65 20 66 6f | 72 20 74 68 65 20 65 72 |ssage fo|r the er|
|00003b10| 72 6f 72 20 6e 75 6d 62 | 65 72 2e 00 00 00 00 3a |ror numb|er.....:|
|00003b20| a4 00 33 00 2a 00 00 00 | 00 01 00 00 00 00 00 00 |..3.*...|........|
|00003b30| 00 45 72 72 6f 72 20 4e | 75 6d 62 65 72 00 00 00 |.Error N|umber...|
|00003b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003b50| 00 00 00 3a e1 00 ad 00 | 39 ff ff 00 14 06 00 01 |...:....|9.......|
|00003b60| e0 00 00 00 00 45 72 72 | 6f 72 20 4d 65 73 73 61 |.....Err|or Messa|
|00003b70| 67 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |ge......|........|
|00003b80| 00 00 00 00 00 00 00 00 | 02 30 00 00 00 00 09 00 |........|.0......|
|00003b90| 00 00 00 00 00 00 00 00 | ff ff ff ff 00 00 00 00 |........|........|
|00003ba0| 00 01 00 00 00 00 03 f1 | 00 00 17 bd 00 04 00 00 |........|........|
|00003bb0| 00 11 00 01 01 4b 02 2e | 00 00 00 00 52 65 67 69 |.....K..|....Regi|
|00003bc0| 73 74 65 72 54 43 50 53 | 65 72 76 65 72 00 00 00 |sterTCPS|erver...|
|00003bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 ff ff ff ff |........|........|
|00003be0| 00 00 00 00 00 01 00 00 | 00 00 18 ab 00 00 1c a0 |........|........|
|00003bf0| 00 05 00 00 00 11 00 01 | 01 4b 02 2e 00 00 00 00 |........|.K......|
|00003c00| 53 65 72 76 65 72 54 43 | 50 52 65 61 64 00 00 00 |ServerTC|PRead...|
|00003c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003c20| ff ff ff ff 00 00 00 00 | 00 01 00 00 00 00 1d c8 |........|........|
|00003c30| 00 00 1f 5f 00 05 00 00 | 00 11 00 01 01 4b 02 2e |..._....|.....K..|
|00003c40| 00 00 00 00 53 65 72 76 | 65 72 54 43 50 57 72 69 |....Serv|erTCPWri|
|00003c50| 74 65 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |te......|........|
|00003c60| 00 00 00 00 ff ff ff ff | 00 00 00 00 00 01 00 00 |........|........|
|00003c70| 00 00 20 87 00 00 22 22 | 00 02 00 00 00 11 00 01 |.. ...""|........|
|00003c80| 01 4b 02 2e 00 00 00 00 | 55 6e 72 65 67 69 73 74 |.K......|Unregist|
|00003c90| 65 72 54 43 50 53 65 72 | 76 65 72 00 00 00 00 00 |erTCPSer|ver.....|
|00003ca0| 00 00 00 00 00 00 00 00 | ff ff ff ff 00 00 00 00 |........|........|
|00003cb0| 00 01 00 00 00 00 22 9d | 00 00 23 93 00 02 00 00 |......".|..#.....|
|00003cc0| 00 11 00 01 01 4b 02 2e | 00 00 00 00 44 69 73 63 |.....K..|....Disc|
|00003cd0| 6f 6e 6e 65 63 74 54 43 | 50 43 6c 69 65 6e 74 00 |onnectTC|PClient.|
|00003ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 ff ff ff ff |........|........|
|00003cf0| 00 00 00 00 00 01 00 00 | 00 00 24 0d 00 00 30 f3 |........|..$...0.|
|00003d00| 00 07 00 00 00 11 00 01 | 01 4b 02 2e 00 00 00 00 |........|.K......|
|00003d10| 43 6f 6e 6e 65 63 74 54 | 6f 54 43 50 53 65 72 76 |ConnectT|oTCPServ|
|00003d20| 65 72 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |er......|........|
|00003d30| ff ff ff ff 00 00 00 00 | 00 01 00 00 00 00 32 97 |........|......2.|
|00003d40| 00 00 34 d9 00 05 00 00 | 00 11 00 01 01 4b 02 2e |..4.....|.....K..|
|00003d50| 00 00 00 00 43 6c 69 65 | 6e 74 54 43 50 52 65 61 |....Clie|ntTCPRea|
|00003d60| 64 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |d.......|........|
|00003d70| 00 00 00 00 ff ff ff ff | 00 00 00 00 00 01 00 00 |........|........|
|00003d80| 00 00 36 01 00 00 37 97 | 00 05 00 00 00 11 00 01 |..6...7.|........|
|00003d90| 01 4b 02 2e 00 00 00 00 | 43 6c 69 65 6e 74 54 43 |.K......|ClientTC|
|00003da0| 50 57 72 69 74 65 00 00 | 00 00 00 00 00 00 00 00 |PWrite..|........|
|00003db0| 00 00 00 00 00 00 00 00 | ff ff ff ff 00 00 00 00 |........|........|
|00003dc0| 00 01 00 00 00 00 38 bf | 00 00 39 b4 00 02 00 00 |......8.|..9.....|
|00003dd0| 00 11 00 01 01 4b 02 2e | 00 00 00 00 44 69 73 63 |.....K..|....Disc|
|00003de0| 6f 6e 6e 65 63 74 46 72 | 6f 6d 54 43 50 53 65 72 |onnectFr|omTCPSer|
|00003df0| 76 65 72 00 00 00 00 00 | 00 00 00 00 ff ff ff ff |ver.....|........|
|00003e00| 00 00 00 00 00 01 00 00 | 00 00 3a 2e 00 00 3b 1d |........|..:...;.|
|00003e10| 00 02 00 00 00 11 00 01 | 01 4b 02 2e 00 00 00 00 |........|.K......|
|00003e20| 47 65 74 54 43 50 45 72 | 72 6f 72 53 74 72 69 6e |GetTCPEr|rorStrin|
|00003e30| 67 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |g.......|........|
|00003e40| 00 00 00 00 00 00 00 96 | 00 00 00 00 00 00 00 00 |........|........|
|00003e50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e60| 00 00 00 00 00 00 00 00 | 01 01 00 00 00 00 03 2d |........|.......-|
|00003e70| 53 65 72 76 65 72 20 46 | 75 6e 63 74 69 6f 6e 73 |Server F|unctions|
|00003e80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003e90| 02 02 00 00 00 00 00 44 | 52 65 67 69 73 74 65 72 |.......D|Register|
|00003ea0| 20 54 43 50 20 53 65 72 | 76 65 72 00 00 00 00 00 | TCP Ser|ver.....|
|00003eb0| 00 00 00 00 00 00 00 00 | 02 02 00 00 00 00 00 44 |........|.......D|
|00003ec0| 53 65 72 76 65 72 20 54 | 43 50 20 52 65 61 64 00 |Server T|CP Read.|
|00003ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ee0| 02 02 00 00 00 00 00 44 | 53 65 72 76 65 72 20 54 |.......D|Server T|
|00003ef0| 43 50 20 57 72 69 74 65 | 00 00 00 00 00 00 00 00 |CP Write|........|
|00003f00| 00 00 00 00 00 00 00 00 | 02 02 00 00 00 00 00 44 |........|.......D|
|00003f10| 55 6e 72 65 67 69 73 74 | 65 72 20 54 43 50 20 53 |Unregist|er TCP S|
|00003f20| 65 72 76 65 72 00 00 00 | 00 00 00 00 00 00 00 00 |erver...|........|
|00003f30| 02 02 00 00 00 00 00 44 | 44 69 73 63 6f 6e 6e 65 |.......D|Disconne|
|00003f40| 63 74 20 54 43 50 20 43 | 6c 69 65 6e 74 00 00 00 |ct TCP C|lient...|
|00003f50| 00 00 00 00 00 00 00 00 | 01 01 00 00 00 00 03 8f |........|........|
|00003f60| 43 6c 69 65 6e 74 20 46 | 75 6e 63 74 69 6f 6e 73 |Client F|unctions|
|00003f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f80| 02 02 00 00 00 00 00 44 | 43 6f 6e 6e 65 63 74 20 |.......D|Connect |
|00003f90| 54 6f 20 54 43 50 20 53 | 65 72 76 65 72 00 00 00 |To TCP S|erver...|
|00003fa0| 00 00 00 00 00 00 00 00 | 02 02 00 00 00 00 00 44 |........|.......D|
|00003fb0| 43 6c 69 65 6e 74 20 54 | 43 50 20 52 65 61 64 00 |Client T|CP Read.|
|00003fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fd0| 02 02 00 00 00 00 00 44 | 43 6c 69 65 6e 74 20 54 |.......D|Client T|
|00003fe0| 43 50 20 57 72 69 74 65 | 00 00 00 00 00 00 00 00 |CP Write|........|
|00003ff0| 00 00 00 00 00 00 00 00 | 02 02 00 00 00 00 00 44 |........|.......D|
|00004000| 44 69 73 63 6f 6e 6e 65 | 63 74 20 46 72 6f 6d 20 |Disconne|ct From |
|00004010| 54 43 50 20 53 65 72 76 | 65 72 00 00 00 00 00 00 |TCP Serv|er......|
|00004020| 02 01 00 00 00 00 00 44 | 47 65 74 20 45 72 72 6f |.......D|Get Erro|
|00004030| 72 20 53 74 72 69 6e 67 | 00 00 00 00 00 00 00 00 |r String|........|
|00004040| 00 00 00 00 00 00 00 00 | |........| |
+--------+-------------------------+-------------------------+--------+--------+