ofs | hex dump | ascii |
---|
0000 | 70 61 63 6b 61 67 65 2e 78 6d 6c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | package.xml..................... |
0020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0060 | 00 00 00 00 31 30 30 36 34 34 20 00 20 20 20 20 20 30 20 00 20 20 20 20 20 30 20 00 20 20 20 20 | ....100644.......0.......0...... |
0080 | 20 20 20 32 34 31 30 20 20 37 35 31 36 37 36 36 30 34 32 20 20 20 36 32 31 35 20 00 00 00 00 00 | ...2410..7516766042...6215...... |
00a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0100 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0120 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0140 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0200 | 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 49 53 | <?xml.version="1.0".encoding="IS |
0220 | 4f 2d 38 38 35 39 2d 31 22 20 3f 3e 0a 3c 70 61 63 6b 61 67 65 20 76 65 72 73 69 6f 6e 3d 22 31 | O-8859-1".?>.<package.version="1 |
0240 | 2e 30 22 3e 0a 20 20 3c 6e 61 6d 65 3e 4e 65 74 5f 53 6f 63 6b 65 74 3c 2f 6e 61 6d 65 3e 0a 20 | .0">...<name>Net_Socket</name>.. |
0260 | 20 3c 73 75 6d 6d 61 72 79 3e 4e 65 74 77 6f 72 6b 20 53 6f 63 6b 65 74 20 49 6e 74 65 72 66 61 | .<summary>Network.Socket.Interfa |
0280 | 63 65 3c 2f 73 75 6d 6d 61 72 79 3e 0a 20 20 3c 64 65 73 63 72 69 70 74 69 6f 6e 3e 4e 65 74 5f | ce</summary>...<description>Net_ |
02a0 | 53 6f 63 6b 65 74 20 69 73 20 61 20 63 6c 61 73 73 20 69 6e 74 65 72 66 61 63 65 20 74 6f 20 54 | Socket.is.a.class.interface.to.T |
02c0 | 43 50 20 73 6f 63 6b 65 74 73 2e 20 20 49 74 20 70 72 6f 76 69 64 65 73 20 62 6c 6f 63 6b 69 6e | CP.sockets...It.provides.blockin |
02e0 | 67 0a 61 6e 64 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 20 6f 70 65 72 61 74 69 6f 6e 2c 20 77 69 | g.and.non-blocking.operation,.wi |
0300 | 74 68 20 64 69 66 66 65 72 65 6e 74 20 72 65 61 64 69 6e 67 20 61 6e 64 20 77 72 69 74 69 6e 67 | th.different.reading.and.writing |
0320 | 20 6d 6f 64 65 73 0a 28 62 79 74 65 2d 77 69 73 65 2c 20 62 6c 6f 63 6b 2d 77 69 73 65 2c 20 6c | .modes.(byte-wise,.block-wise,.l |
0340 | 69 6e 65 2d 77 69 73 65 20 61 6e 64 20 73 70 65 63 69 61 6c 20 66 6f 72 6d 61 74 73 20 6c 69 6b | ine-wise.and.special.formats.lik |
0360 | 65 20 6e 65 74 77 6f 72 6b 0a 62 79 74 65 2d 6f 72 64 65 72 20 69 70 20 61 64 64 72 65 73 73 65 | e.network.byte-order.ip.addresse |
0380 | 73 29 2e 3c 2f 64 65 73 63 72 69 70 74 69 6f 6e 3e 0a 20 20 3c 6d 61 69 6e 74 61 69 6e 65 72 73 | s).</description>...<maintainers |
03a0 | 3e 0a 20 20 20 20 3c 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 20 20 3c 75 73 65 72 3e 73 | >.....<maintainer>.......<user>s |
03c0 | 73 62 3c 2f 75 73 65 72 3e 0a 20 20 20 20 20 20 3c 6e 61 6d 65 3e 53 74 69 67 20 53 e6 74 68 65 | sb</user>.......<name>Stig.S.the |
03e0 | 72 20 42 61 6b 6b 65 6e 3c 2f 6e 61 6d 65 3e 0a 20 20 20 20 20 20 3c 65 6d 61 69 6c 3e 73 74 69 | r.Bakken</name>.......<email>sti |
0400 | 67 40 70 68 70 2e 6e 65 74 3c 2f 65 6d 61 69 6c 3e 0a 20 20 20 20 20 20 3c 72 6f 6c 65 3e 6c 65 | g@php.net</email>.......<role>le |
0420 | 61 64 3c 2f 72 6f 6c 65 3e 0a 20 20 20 20 3c 2f 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 | ad</role>.....</maintainer>..... |
0440 | 3c 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 20 20 3c 75 73 65 72 3e 63 68 61 67 65 6e 62 | <maintainer>.......<user>chagenb |
0460 | 75 3c 2f 75 73 65 72 3e 0a 20 20 20 20 20 20 3c 6e 61 6d 65 3e 43 68 75 63 6b 20 48 61 67 65 6e | u</user>.......<name>Chuck.Hagen |
0480 | 62 75 63 68 3c 2f 6e 61 6d 65 3e 0a 20 20 20 20 20 20 3c 65 6d 61 69 6c 3e 63 68 75 63 6b 40 68 | buch</name>.......<email>chuck@h |
04a0 | 6f 72 64 65 2e 6f 72 67 3c 2f 65 6d 61 69 6c 3e 0a 20 20 20 20 20 20 3c 72 6f 6c 65 3e 6c 65 61 | orde.org</email>.......<role>lea |
04c0 | 64 3c 2f 72 6f 6c 65 3e 0a 20 20 20 20 3c 2f 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 3c 2f 6d | d</role>.....</maintainer>...</m |
04e0 | 61 69 6e 74 61 69 6e 65 72 73 3e 0a 20 20 3c 72 65 6c 65 61 73 65 3e 0a 20 20 20 20 3c 76 65 72 | aintainers>...<release>.....<ver |
0500 | 73 69 6f 6e 3e 31 2e 30 2e 31 3c 2f 76 65 72 73 69 6f 6e 3e 0a 20 20 20 20 3c 64 61 74 65 3e 32 | sion>1.0.1</version>.....<date>2 |
0520 | 30 30 32 2d 30 34 2d 30 34 3c 2f 64 61 74 65 3e 0a 20 20 20 20 3c 6c 69 63 65 6e 73 65 3e 50 48 | 002-04-04</date>.....<license>PH |
0540 | 50 20 32 2e 30 32 3c 2f 6c 69 63 65 6e 73 65 3e 0a 20 20 20 20 3c 73 74 61 74 65 3e 73 74 61 62 | P.2.02</license>.....<state>stab |
0560 | 6c 65 3c 2f 73 74 61 74 65 3e 0a 20 20 20 20 3c 6e 6f 74 65 73 3e 54 6f 75 63 68 20 75 70 20 65 | le</state>.....<notes>Touch.up.e |
0580 | 72 72 6f 72 20 68 61 6e 64 6c 69 6e 67 2e 3c 2f 6e 6f 74 65 73 3e 0a 20 20 20 20 3c 66 69 6c 65 | rror.handling.</notes>.....<file |
05a0 | 6c 69 73 74 3e 0a 20 20 20 20 20 20 3c 66 69 6c 65 20 72 6f 6c 65 3d 22 70 68 70 22 20 62 61 73 | list>.......<file.role="php".bas |
05c0 | 65 69 6e 73 74 61 6c 6c 64 69 72 3d 22 4e 65 74 22 20 6d 64 35 73 75 6d 3d 22 64 62 38 62 31 63 | einstalldir="Net".md5sum="db8b1c |
05e0 | 39 30 39 62 37 61 65 32 30 30 66 63 34 63 63 64 34 34 65 37 37 31 31 39 31 39 22 20 6e 61 6d 65 | 909b7ae200fc4ccd44e7711919".name |
0600 | 3d 22 53 6f 63 6b 65 74 2e 70 68 70 22 2f 3e 0a 20 20 20 20 3c 2f 66 69 6c 65 6c 69 73 74 3e 0a | ="Socket.php"/>.....</filelist>. |
0620 | 20 20 3c 2f 72 65 6c 65 61 73 65 3e 0a 20 20 3c 63 68 61 6e 67 65 6c 6f 67 3e 0a 20 20 20 20 3c | ..</release>...<changelog>.....< |
0640 | 72 65 6c 65 61 73 65 3e 0a 20 20 20 20 20 20 3c 76 65 72 73 69 6f 6e 3e 31 2e 30 3c 2f 76 65 72 | release>.......<version>1.0</ver |
0660 | 73 69 6f 6e 3e 0a 20 20 20 20 20 20 3c 64 61 74 65 3e 32 30 30 32 2d 30 34 2d 30 31 3c 2f 64 61 | sion>.......<date>2002-04-01</da |
0680 | 74 65 3e 0a 20 20 20 20 20 20 3c 73 74 61 74 65 3e 73 74 61 62 6c 65 3c 2f 73 74 61 74 65 3e 0a | te>.......<state>stable</state>. |
06a0 | 20 20 20 20 20 20 3c 6e 6f 74 65 73 3e 46 69 72 73 74 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 72 | ......<notes>First.independent.r |
06c0 | 65 6c 65 61 73 65 20 6f 66 20 4e 65 74 5f 53 6f 63 6b 65 74 2e 0a 3c 2f 6e 6f 74 65 73 3e 0a 20 | elease.of.Net_Socket..</notes>.. |
06e0 | 20 20 20 3c 2f 72 65 6c 65 61 73 65 3e 0a 20 20 3c 2f 63 68 61 6e 67 65 6c 6f 67 3e 0a 3c 2f 70 | ...</release>...</changelog>.</p |
0700 | 61 63 6b 61 67 65 3e 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ackage>......................... |
0720 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0740 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0760 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0780 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
07a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
07c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
07e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0800 | 4e 65 74 5f 53 6f 63 6b 65 74 2d 31 2e 30 2e 31 2f 53 6f 63 6b 65 74 2e 70 68 70 00 00 00 00 00 | Net_Socket-1.0.1/Socket.php..... |
0820 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0840 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0860 | 00 00 00 00 31 30 30 36 34 34 20 00 20 20 20 20 20 30 20 00 20 20 20 20 20 30 20 00 20 20 20 20 | ....100644.......0.......0...... |
0880 | 20 20 33 30 36 31 33 20 20 37 34 35 34 31 35 31 33 35 35 20 20 31 30 35 35 34 20 00 00 00 00 00 | ..30613..7454151355..10554...... |
08a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
08c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
08e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0a00 | 3c 3f 70 68 70 0a 2f 2f 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php.//.//.+------------------- |
0a20 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0a40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 50 48 50 20 56 65 | -------------------+.//.|.PHP.Ve |
0a60 | 72 73 69 6f 6e 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | rsion.4......................... |
0a80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | ...............................| |
0aa0 | 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .//.+--------------------------- |
0ac0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0ae0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 | -----------+.//.|.Copyright.(c). |
0b00 | 31 39 39 37 2d 32 30 30 32 20 54 68 65 20 50 48 50 20 47 72 6f 75 70 20 20 20 20 20 20 20 20 20 | 1997-2002.The.PHP.Group......... |
0b20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | .......................|.//.+--- |
0b40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0b60 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0b80 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 54 68 69 73 20 73 6f 75 72 63 65 20 66 69 6c 65 20 69 73 20 73 75 | ---+.//.|.This.source.file.is.su |
0ba0 | 62 6a 65 63 74 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 30 20 6f 66 20 74 68 65 20 50 48 50 20 | bject.to.version.2.0.of.the.PHP. |
0bc0 | 6c 69 63 65 6e 73 65 2c 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 74 68 61 74 20 69 73 20 62 75 | license,.......|.//.|.that.is.bu |
0be0 | 6e 64 6c 65 64 20 77 69 74 68 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 69 6e 20 74 68 65 20 66 | ndled.with.this.package.in.the.f |
0c00 | 69 6c 65 20 4c 49 43 45 4e 53 45 2c 20 61 6e 64 20 69 73 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ile.LICENSE,.and.is........|.//. |
0c20 | 7c 20 61 76 61 69 6c 61 62 6c 65 20 61 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c 64 | |.available.at.through.the.world |
0c40 | 2d 77 69 64 65 2d 77 65 62 20 61 74 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | -wide-web.at.................... |
0c60 | 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 68 74 74 70 3a 2f 2f 77 77 77 2e 70 68 70 2e 6e 65 74 | .......|.//.|.http://www.php.net |
0c80 | 2f 6c 69 63 65 6e 73 65 2f 32 5f 30 32 2e 74 78 74 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | /license/2_02.txt............... |
0ca0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 49 66 20 79 6f 75 | ...................|.//.|.If.you |
0cc0 | 20 64 69 64 20 6e 6f 74 20 72 65 63 65 69 76 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 50 | .did.not.receive.a.copy.of.the.P |
0ce0 | 48 50 20 6c 69 63 65 6e 73 65 20 61 6e 64 20 61 72 65 20 75 6e 61 62 6c 65 20 74 6f 20 20 20 7c | HP.license.and.are.unable.to...| |
0d00 | 0a 2f 2f 20 7c 20 6f 62 74 61 69 6e 20 69 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c | .//.|.obtain.it.through.the.worl |
0d20 | 64 2d 77 69 64 65 2d 77 65 62 2c 20 70 6c 65 61 73 65 20 73 65 6e 64 20 61 20 6e 6f 74 65 20 74 | d-wide-web,.please.send.a.note.t |
0d40 | 6f 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 6c 69 63 65 6e 73 65 40 70 68 70 2e 6e 65 | o..........|.//.|.license@php.ne |
0d60 | 74 20 73 6f 20 77 65 20 63 61 6e 20 6d 61 69 6c 20 79 6f 75 20 61 20 63 6f 70 79 20 69 6d 6d 65 | t.so.we.can.mail.you.a.copy.imme |
0d80 | 64 69 61 74 65 6c 79 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | diately................|.//.+--- |
0da0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0dc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0de0 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 73 3a 20 53 74 69 67 20 42 61 6b 6b 65 6e 20 3c | ---+.//.|.Authors:.Stig.Bakken.< |
0e00 | 73 73 62 40 66 61 73 74 2e 6e 6f 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ssb@fast.no>.................... |
0e20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 20 20 20 20 20 20 20 20 20 43 | ...............|.//.|..........C |
0e40 | 68 75 63 6b 20 48 61 67 65 6e 62 75 63 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e | huck.Hagenbuch.<chuck@horde.org> |
0e60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ...........................|.//. |
0e80 | 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | +------------------------------- |
0ea0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0ec0 | 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 0a 2f 2f 20 24 49 64 3a 20 53 6f 63 6b 65 74 2e 70 68 70 2c 76 | -------+.//.//.$Id:.Socket.php,v |
0ee0 | 20 31 2e 32 20 32 30 30 32 2f 30 34 2f 30 33 20 32 31 3a 34 39 3a 31 36 20 73 73 62 20 45 78 70 | .1.2.2002/04/03.21:49:16.ssb.Exp |
0f00 | 20 24 0a 2f 2f 0a 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 20 27 50 45 41 52 2e 70 68 70 27 3b 0a | .$.//..require_once.'PEAR.php';. |
0f20 | 0a 2f 2a 2a 0a 20 2a 20 47 65 6e 65 72 61 6c 69 7a 65 64 20 53 6f 63 6b 65 74 20 63 6c 61 73 73 | ./**..*.Generalized.Socket.class |
0f40 | 2e 20 4d 6f 72 65 20 64 6f 63 73 20 74 6f 20 62 65 20 77 72 69 74 74 65 6e 2e 0a 20 2a 0a 20 2a | ..More.docs.to.be.written...*..* |
0f60 | 20 40 76 65 72 73 69 6f 6e 20 31 2e 30 0a 20 2a 20 40 61 75 74 68 6f 72 20 53 74 69 67 20 42 61 | .@version.1.0..*.@author.Stig.Ba |
0f80 | 6b 6b 65 6e 20 3c 73 73 62 40 66 61 73 74 2e 6e 6f 3e 0a 20 2a 20 40 61 75 74 68 6f 72 20 43 68 | kken.<ssb@fast.no>..*.@author.Ch |
0fa0 | 75 63 6b 20 48 61 67 65 6e 62 75 63 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e 0a | uck.Hagenbuch.<chuck@horde.org>. |
0fc0 | 20 2a 2f 0a 63 6c 61 73 73 20 4e 65 74 5f 53 6f 63 6b 65 74 20 65 78 74 65 6e 64 73 20 50 45 41 | .*/.class.Net_Socket.extends.PEA |
0fe0 | 52 20 7b 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 70 72 6f 70 65 72 74 69 65 73 0a 20 | R.{..........//.{{{.properties.. |
1000 | 20 20 20 0a 20 20 20 20 2f 2a 2a 20 53 6f 63 6b 65 74 20 66 69 6c 65 20 70 6f 69 6e 74 65 72 2e | ......../**.Socket.file.pointer. |
1020 | 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 66 70 20 3d 20 6e 75 6c 6c 3b 0a 20 20 20 20 0a 20 20 20 | .*/.....var.$fp.=.null;......... |
1040 | 20 2f 2a 2a 20 57 68 65 74 68 65 72 20 74 68 65 20 73 6f 63 6b 65 74 20 69 73 20 62 6c 6f 63 6b | ./**.Whether.the.socket.is.block |
1060 | 69 6e 67 2e 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 62 6c 6f 63 6b 69 6e 67 20 3d 20 74 72 75 65 | ing..*/.....var.$blocking.=.true |
1080 | 3b 0a 20 20 20 20 0a 20 20 20 20 2f 2a 2a 20 57 68 65 74 68 65 72 20 74 68 65 20 73 6f 63 6b 65 | ;........../**.Whether.the.socke |
10a0 | 74 20 69 73 20 70 65 72 73 69 73 74 65 6e 74 2e 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 70 65 72 | t.is.persistent..*/.....var.$per |
10c0 | 73 69 73 74 65 6e 74 20 3d 20 66 61 6c 73 65 3b 0a 20 20 20 20 0a 20 20 20 20 2f 2a 2a 20 54 68 | sistent.=.false;........../**.Th |
10e0 | 65 20 49 50 20 61 64 64 72 65 73 73 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f 2e 20 2a 2f 0a 20 | e.IP.address.to.connect.to..*/.. |
1100 | 20 20 20 76 61 72 20 24 61 64 64 72 20 3d 20 27 27 3b 0a 20 20 20 20 0a 20 20 20 20 2f 2a 2a 20 | ...var.$addr.=.'';........../**. |
1120 | 54 68 65 20 70 6f 72 74 20 6e 75 6d 62 65 72 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f 2e 20 2a | The.port.number.to.connect.to..* |
1140 | 2f 0a 20 20 20 20 76 61 72 20 24 70 6f 72 74 20 3d 20 30 3b 0a 20 20 20 20 0a 20 20 20 20 2f 2a | /.....var.$port.=.0;........../* |
1160 | 2a 20 4e 75 6d 62 65 72 20 6f 66 20 73 65 63 6f 6e 64 73 20 74 6f 20 77 61 69 74 20 6f 6e 20 73 | *.Number.of.seconds.to.wait.on.s |
1180 | 6f 63 6b 65 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 62 65 66 6f 72 65 0a 20 20 20 20 20 20 20 | ocket.connections.before........ |
11a0 | 20 61 73 73 75 6d 69 6e 67 20 74 68 65 72 65 27 73 20 6e 6f 20 6d 6f 72 65 20 64 61 74 61 2e 20 | .assuming.there's.no.more.data.. |
11c0 | 2a 2f 0a 20 20 20 20 76 61 72 20 24 74 69 6d 65 6f 75 74 20 3d 20 66 61 6c 73 65 3b 0a 20 20 20 | */.....var.$timeout.=.false;.... |
11e0 | 20 0a 20 20 20 20 2f 2a 2a 20 4e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 74 6f 20 72 65 61 | ....../**.Number.of.bytes.to.rea |
1200 | 64 20 61 74 20 61 20 74 69 6d 65 20 69 6e 20 72 65 61 64 4c 69 6e 65 28 29 20 61 6e 64 0a 20 20 | d.at.a.time.in.readLine().and... |
1220 | 20 20 20 20 20 20 72 65 61 64 41 6c 6c 28 29 2e 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 6c 69 6e | ......readAll()..*/.....var.$lin |
1240 | 65 4c 65 6e 67 74 68 20 3d 20 32 30 34 38 3b 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a | eLength.=.2048;.....//.}}}...... |
1260 | 20 20 20 20 2f 2f 20 7b 7b 7b 20 63 6f 6e 73 74 72 75 63 74 6f 72 0a 20 20 20 20 2f 2a 2a 0a 20 | ....//.{{{.constructor...../**.. |
1280 | 20 20 20 20 2a 20 43 6f 6e 73 74 72 75 63 74 73 20 61 20 6e 65 77 20 4e 65 74 5f 53 6f 63 6b 65 | ....*.Constructs.a.new.Net_Socke |
12a0 | 74 20 6f 62 6a 65 63 74 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 | t.object.......*......*.@access. |
12c0 | 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 4e 65 74 5f | public......*/.....function.Net_ |
12e0 | 53 6f 63 6b 65 74 28 29 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 50 45 41 52 28 29 | Socket().{.........$this->PEAR() |
1300 | 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b | ;.....}.....//.}}}..........//.{ |
1320 | 7b 7b 20 63 6f 6e 6e 65 63 74 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 43 6f 6e 6e | {{.connect()...../**......*.Conn |
1340 | 65 63 74 20 74 6f 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 70 6f 72 74 2e 20 49 66 20 63 61 | ect.to.the.specified.port..If.ca |
1360 | 6c 6c 65 64 20 77 68 65 6e 20 74 68 65 20 73 6f 63 6b 65 74 20 69 73 0a 20 20 20 20 20 2a 20 61 | lled.when.the.socket.is......*.a |
1380 | 6c 72 65 61 64 79 20 63 6f 6e 6e 65 63 74 65 64 2c 20 69 74 20 64 69 73 63 6f 6e 6e 65 63 74 73 | lready.connected,.it.disconnects |
13a0 | 20 61 6e 64 20 63 6f 6e 6e 65 63 74 73 20 61 67 61 69 6e 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 | .and.connects.again.......*..... |
13c0 | 20 2a 20 40 70 61 72 61 6d 20 24 61 64 64 72 20 73 74 72 69 6e 67 20 49 50 20 61 64 64 72 65 73 | .*.@param.$addr.string.IP.addres |
13e0 | 73 20 6f 72 20 68 6f 73 74 20 6e 61 6d 65 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 24 70 6f | s.or.host.name......*.@param.$po |
1400 | 72 74 20 69 6e 74 20 54 43 50 20 70 6f 72 74 20 6e 75 6d 62 65 72 0a 20 20 20 20 20 2a 20 40 70 | rt.int.TCP.port.number......*.@p |
1420 | 61 72 61 6d 20 24 70 65 72 73 69 73 74 65 6e 74 20 62 6f 6f 6c 20 28 6f 70 74 69 6f 6e 61 6c 29 | aram.$persistent.bool.(optional) |
1440 | 20 77 68 65 74 68 65 72 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 69 73 0a 20 20 20 20 20 | .whether.the.connection.is...... |
1460 | 2a 20 20 20 20 20 20 20 20 70 65 72 73 69 73 74 65 6e 74 20 28 6b 65 70 74 20 6f 70 65 6e 20 62 | *........persistent.(kept.open.b |
1480 | 65 74 77 65 65 6e 20 72 65 71 75 65 73 74 73 20 62 79 20 74 68 65 20 77 65 62 20 73 65 72 76 65 | etween.requests.by.the.web.serve |
14a0 | 72 29 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 24 74 69 6d 65 6f 75 74 20 69 6e 74 20 28 6f | r)......*.@param.$timeout.int.(o |
14c0 | 70 74 69 6f 6e 61 6c 29 20 68 6f 77 20 6c 6f 6e 67 20 74 6f 20 77 61 69 74 20 66 6f 72 20 64 61 | ptional).how.long.to.wait.for.da |
14e0 | 74 61 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 | ta......*.@access.public......*. |
1500 | 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 20 6f 72 | @return.mixed.true.on.success.or |
1520 | 20 65 72 72 6f 72 20 6f 62 6a 65 63 74 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 | .error.object......*/.....functi |
1540 | 6f 6e 20 63 6f 6e 6e 65 63 74 28 24 61 64 64 72 2c 20 24 70 6f 72 74 2c 20 24 70 65 72 73 69 73 | on.connect($addr,.$port,.$persis |
1560 | 74 65 6e 74 20 3d 20 6e 75 6c 6c 2c 20 24 74 69 6d 65 6f 75 74 20 3d 20 6e 75 6c 6c 29 20 7b 0a | tent.=.null,.$timeout.=.null).{. |
1580 | 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 | ........if.(is_resource($this->f |
15a0 | 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 40 66 63 6c 6f 73 65 28 24 74 68 69 73 2d | p)).{.............@fclose($this- |
15c0 | 3e 66 70 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 66 70 20 3d 20 6e 75 | >fp);.............$this->fp.=.nu |
15e0 | 6c 6c 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 69 | ll;.........}..................i |
1600 | 66 20 28 73 74 72 73 70 6e 28 24 61 64 64 72 2c 20 27 2e 30 31 32 33 34 35 36 37 38 39 27 29 20 | f.(strspn($addr,.'.0123456789'). |
1620 | 3d 3d 20 73 74 72 6c 65 6e 28 24 61 64 64 72 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ==.strlen($addr)).{............. |
1640 | 24 74 68 69 73 2d 3e 61 64 64 72 20 3d 20 24 61 64 64 72 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 | $this->addr.=.$addr;.........}.e |
1660 | 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 61 64 64 72 20 3d 20 | lse.{.............$this->addr.=. |
1680 | 67 65 74 68 6f 73 74 62 79 6e 61 6d 65 28 24 61 64 64 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a | gethostbyname($addr);.........}. |
16a0 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 70 6f 72 74 20 3d 20 24 70 6f 72 74 20 25 20 36 35 | ........$this->port.=.$port.%.65 |
16c0 | 35 33 36 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 70 65 72 73 69 73 74 65 6e 74 20 21 3d 3d | 536;.........if.($persistent.!== |
16e0 | 20 6e 75 6c 6c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 70 65 72 73 | .null).{.............$this->pers |
1700 | 69 73 74 65 6e 74 20 3d 20 24 70 65 72 73 69 73 74 65 6e 74 3b 0a 20 20 20 20 20 20 20 20 7d 0a | istent.=.$persistent;.........}. |
1720 | 20 20 20 20 20 20 20 20 69 66 20 28 24 74 69 6d 65 6f 75 74 20 21 3d 3d 20 6e 75 6c 6c 29 20 7b | ........if.($timeout.!==.null).{ |
1740 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 69 6d 65 6f 75 74 20 3d 20 24 74 | .............$this->timeout.=.$t |
1760 | 69 6d 65 6f 75 74 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 70 65 6e 66 | imeout;.........}.........$openf |
1780 | 75 6e 63 20 3d 20 24 74 68 69 73 2d 3e 70 65 72 73 69 73 74 65 6e 74 20 3f 20 27 70 66 73 6f 63 | unc.=.$this->persistent.?.'pfsoc |
17a0 | 6b 6f 70 65 6e 27 20 3a 20 27 66 73 6f 63 6b 6f 70 65 6e 27 3b 0a 20 20 20 20 20 20 20 20 24 65 | kopen'.:.'fsockopen';.........$e |
17c0 | 72 72 6e 6f 20 3d 20 30 3b 0a 20 20 20 20 20 20 20 20 24 65 72 72 73 74 72 20 3d 20 27 27 3b 0a | rrno.=.0;.........$errstr.=.'';. |
17e0 | 20 20 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 74 69 6d 65 6f 75 74 29 20 7b 0a 20 20 | ........if.($this->timeout).{... |
1800 | 20 20 20 20 20 20 20 20 20 20 24 66 70 20 3d 20 24 6f 70 65 6e 66 75 6e 63 28 24 74 68 69 73 2d | ..........$fp.=.$openfunc($this- |
1820 | 3e 61 64 64 72 2c 20 24 74 68 69 73 2d 3e 70 6f 72 74 2c 20 24 65 72 72 6e 6f 2c 20 24 65 72 72 | >addr,.$this->port,.$errno,.$err |
1840 | 73 74 72 2c 20 24 74 68 69 73 2d 3e 74 69 6d 65 6f 75 74 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 | str,.$this->timeout);.........}. |
1860 | 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 66 70 20 3d 20 24 6f 70 65 6e 66 75 | else.{.............$fp.=.$openfu |
1880 | 6e 63 28 24 74 68 69 73 2d 3e 61 64 64 72 2c 20 24 74 68 69 73 2d 3e 70 6f 72 74 2c 20 24 65 72 | nc($this->addr,.$this->port,.$er |
18a0 | 72 6e 6f 2c 20 24 65 72 72 73 74 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | rno,.$errstr);.........}........ |
18c0 | 20 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 66 70 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | ..........if.(!$fp).{........... |
18e0 | 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 24 65 72 72 73 | ..return.$this->raiseError($errs |
1900 | 74 72 2c 20 24 65 72 72 6e 6f 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 | tr,.$errno);.........}.......... |
1920 | 24 74 68 69 73 2d 3e 66 70 20 3d 20 24 66 70 3b 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 | $this->fp.=.$fp;................ |
1940 | 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 65 74 42 6c 6f 63 6b 69 6e 67 28 24 74 68 69 | ..return.$this->setBlocking($thi |
1960 | 73 2d 3e 62 6c 6f 63 6b 69 6e 67 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 | s->blocking);.....}.....//.}}}.. |
1980 | 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 64 69 73 63 6f 6e 6e 65 63 74 28 29 0a 20 20 20 20 | ........//.{{{.disconnect()..... |
19a0 | 2f 2a 2a 0a 20 20 20 20 20 2a 20 44 69 73 63 6f 6e 6e 65 63 74 73 20 66 72 6f 6d 20 74 68 65 20 | /**......*.Disconnects.from.the. |
19c0 | 70 65 65 72 2c 20 63 6c 6f 73 65 73 20 74 68 65 20 73 6f 63 6b 65 74 2e 0a 20 20 20 20 20 2a 0a | peer,.closes.the.socket.......*. |
19e0 | 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 | .....*.@access.public......*.@re |
1a00 | 74 75 72 6e 20 6d 69 78 65 64 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 20 6f 72 20 61 6e | turn.mixed.true.on.success.or.an |
1a20 | 20 65 72 72 6f 72 20 6f 62 6a 65 63 74 20 6f 74 68 65 72 77 69 73 65 0a 20 20 20 20 20 2a 2f 0a | .error.object.otherwise......*/. |
1a40 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 64 69 73 63 6f 6e 6e 65 63 74 28 29 20 7b 0a 20 20 20 20 | ....function.disconnect().{..... |
1a60 | 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 | ....if.(is_resource($this->fp)). |
1a80 | 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 63 6c 6f 73 65 28 24 74 68 69 73 2d 3e 66 70 29 3b | {.............fclose($this->fp); |
1aa0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 66 70 20 3d 20 6e 75 6c 6c 3b 0a 20 | .............$this->fp.=.null;.. |
1ac0 | 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 | ...........return.true;......... |
1ae0 | 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 | }.........return.$this->raiseErr |
1b00 | 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f | or("not.connected");.....}...../ |
1b20 | 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 69 73 42 6c 6f 63 6b 69 6e 67 | /.}}}..........//.{{{.isBlocking |
1b40 | 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 46 69 6e 64 20 6f 75 74 20 69 66 20 74 68 | ()...../**......*.Find.out.if.th |
1b60 | 65 20 73 6f 63 6b 65 74 20 69 73 20 69 6e 20 62 6c 6f 63 6b 69 6e 67 20 6d 6f 64 65 2e 0a 20 20 | e.socket.is.in.blocking.mode.... |
1b80 | 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 | ...*......*.@access.public...... |
1ba0 | 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 20 74 68 65 20 63 75 72 72 65 6e 74 20 62 6c 6f 63 6b | *.@return.bool.the.current.block |
1bc0 | 69 6e 67 20 6d 6f 64 65 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 69 | ing.mode.......*/.....function.i |
1be0 | 73 42 6c 6f 63 6b 69 6e 67 28 29 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 | sBlocking().{.........return.$th |
1c00 | 69 73 2d 3e 62 6c 6f 63 6b 69 6e 67 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 | is->blocking;.....}.....//.}}}.. |
1c20 | 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 73 65 74 42 6c 6f 63 6b 69 6e 67 28 29 0a 20 20 20 | ........//.{{{.setBlocking().... |
1c40 | 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 53 65 74 73 20 77 68 65 74 68 65 72 20 74 68 65 20 73 6f 63 | ./**......*.Sets.whether.the.soc |
1c60 | 6b 65 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 68 6f 75 6c 64 20 62 65 20 62 6c 6f 63 6b 69 6e | ket.connection.should.be.blockin |
1c80 | 67 20 6f 72 0a 20 20 20 20 20 2a 20 6e 6f 74 2e 20 41 20 72 65 61 64 20 63 61 6c 6c 20 74 6f 20 | g.or......*.not..A.read.call.to. |
1ca0 | 61 20 6e 6f 6e 2d 62 6c 6f 63 6b 69 6e 67 20 73 6f 63 6b 65 74 20 77 69 6c 6c 20 72 65 74 75 72 | a.non-blocking.socket.will.retur |
1cc0 | 6e 20 69 6d 6d 65 64 69 61 74 65 6c 79 0a 20 20 20 20 20 2a 20 69 66 20 74 68 65 72 65 20 69 73 | n.immediately......*.if.there.is |
1ce0 | 20 6e 6f 20 64 61 74 61 20 61 76 61 69 6c 61 62 6c 65 2c 20 77 68 65 72 65 61 73 20 69 74 20 77 | .no.data.available,.whereas.it.w |
1d00 | 69 6c 6c 20 62 6c 6f 63 6b 20 75 6e 74 69 6c 20 74 68 65 72 65 0a 20 20 20 20 20 2a 20 69 73 20 | ill.block.until.there......*.is. |
1d20 | 64 61 74 61 20 66 6f 72 20 62 6c 6f 63 6b 69 6e 67 20 73 6f 63 6b 65 74 73 2e 0a 20 20 20 20 20 | data.for.blocking.sockets....... |
1d40 | 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 24 6d 6f 64 65 20 62 6f 6f 6c 20 74 72 75 65 20 | *......*.@param.$mode.bool.true. |
1d60 | 66 6f 72 20 62 6c 6f 63 6b 69 6e 67 20 73 6f 63 6b 65 74 73 2c 20 66 61 6c 73 65 20 66 6f 72 20 | for.blocking.sockets,.false.for. |
1d80 | 6e 6f 6e 62 6c 6f 63 6b 69 6e 67 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 | nonblocking......*.@access.publi |
1da0 | 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 74 72 75 65 20 6f 6e 20 73 | c......*.@return.mixed.true.on.s |
1dc0 | 75 63 63 65 73 73 20 6f 72 20 61 6e 20 65 72 72 6f 72 20 6f 62 6a 65 63 74 20 6f 74 68 65 72 77 | uccess.or.an.error.object.otherw |
1de0 | 69 73 65 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 42 6c 6f 63 | ise......*/.....function.setBloc |
1e00 | 6b 69 6e 67 28 24 6d 6f 64 65 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 | king($mode).{.........if.(is_res |
1e20 | 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ource($this->fp)).{............. |
1e40 | 24 74 68 69 73 2d 3e 62 6c 6f 63 6b 69 6e 67 20 3d 20 24 6d 6f 64 65 3b 0a 20 20 20 20 20 20 20 | $this->blocking.=.$mode;........ |
1e60 | 20 20 20 20 20 73 6f 63 6b 65 74 5f 73 65 74 5f 62 6c 6f 63 6b 69 6e 67 28 24 74 68 69 73 2d 3e | .....socket_set_blocking($this-> |
1e80 | 66 70 2c 20 24 74 68 69 73 2d 3e 62 6c 6f 63 6b 69 6e 67 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | fp,.$this->blocking);........... |
1ea0 | 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | ..return.true;.........}........ |
1ec0 | 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 | .return.$this->raiseError("not.c |
1ee0 | 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 0a 20 20 | onnected");.....}.....//.}}}.... |
1f00 | 20 20 2f 2f 20 7b 7b 7b 20 73 65 74 54 69 6d 65 6f 75 74 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 | ..//.{{{.setTimeout()...../**... |
1f20 | 20 20 20 2a 20 53 65 74 73 20 74 68 65 20 74 69 6d 65 6f 75 74 20 76 61 6c 75 65 20 6f 6e 20 73 | ...*.Sets.the.timeout.value.on.s |
1f40 | 6f 63 6b 65 74 20 64 65 73 63 72 69 70 74 6f 72 2c 20 0a 20 20 20 20 20 2a 20 65 78 70 72 65 73 | ocket.descriptor,.......*.expres |
1f60 | 73 65 64 20 69 6e 20 74 68 65 20 73 75 6d 20 6f 66 20 73 65 63 6f 6e 64 73 20 61 6e 64 20 6d 69 | sed.in.the.sum.of.seconds.and.mi |
1f80 | 63 72 6f 73 65 63 6f 6e 64 73 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 | croseconds......*......*.@param. |
1fa0 | 24 73 65 63 6f 6e 64 73 20 69 6e 74 20 73 65 63 6f 6e 64 73 0a 20 20 20 20 20 2a 20 40 70 61 72 | $seconds.int.seconds......*.@par |
1fc0 | 61 6d 20 24 6d 69 63 72 6f 73 65 63 6f 6e 64 73 20 69 6e 74 20 6d 69 63 72 6f 73 65 63 6f 6e 64 | am.$microseconds.int.microsecond |
1fe0 | 73 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 | s......*.@access.public......*.@ |
2000 | 72 65 74 75 72 6e 20 6d 69 78 65 64 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 20 6f 72 20 | return.mixed.true.on.success.or. |
2020 | 61 6e 20 65 72 72 6f 72 20 6f 62 6a 65 63 74 20 6f 74 68 65 72 77 69 73 65 0a 20 20 20 20 20 2a | an.error.object.otherwise......* |
2040 | 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 54 69 6d 65 6f 75 74 28 24 73 65 63 6f 6e | /.....function.setTimeout($secon |
2060 | 64 73 2c 20 24 6d 69 63 72 6f 73 65 63 6f 6e 64 73 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 | ds,.$microseconds).{.........if. |
2080 | 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 | (is_resource($this->fp)).{...... |
20a0 | 20 20 20 20 20 20 20 73 6f 63 6b 65 74 5f 73 65 74 5f 74 69 6d 65 6f 75 74 28 24 74 68 69 73 2d | .......socket_set_timeout($this- |
20c0 | 3e 66 70 2c 20 24 73 65 63 6f 6e 64 73 2c 20 24 6d 69 63 72 6f 73 65 63 6f 6e 64 73 29 3b 0a 20 | >fp,.$seconds,.$microseconds);.. |
20e0 | 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 | ...........return.true;......... |
2100 | 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 | }.........return.$this->raiseErr |
2120 | 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f | or("not.connected");.....}...../ |
2140 | 2f 20 7d 7d 7d 0a 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 67 65 74 53 74 61 74 75 73 28 29 0a 20 20 | /.}}}......//.{{{.getStatus()... |
2160 | 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 74 75 72 6e 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e | ../**......*.Returns.information |
2180 | 20 61 62 6f 75 74 20 61 6e 20 65 78 69 73 74 69 6e 67 20 73 6f 63 6b 65 74 20 72 65 73 6f 75 72 | .about.an.existing.socket.resour |
21a0 | 63 65 2e 20 0a 20 20 20 20 20 2a 20 43 75 72 72 65 6e 74 6c 79 20 72 65 74 75 72 6e 73 20 66 6f | ce........*.Currently.returns.fo |
21c0 | 75 72 20 65 6e 74 72 69 65 73 20 69 6e 20 74 68 65 20 72 65 73 75 6c 74 20 61 72 72 61 79 3a 20 | ur.entries.in.the.result.array:. |
21e0 | 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 3c 70 3e 0a 20 20 20 20 20 2a 20 74 69 6d 65 64 5f | ......*......*.<p>......*.timed_ |
2200 | 6f 75 74 20 28 62 6f 6f 6c 29 20 2d 20 54 68 65 20 73 6f 63 6b 65 74 20 74 69 6d 65 64 20 6f 75 | out.(bool).-.The.socket.timed.ou |
2220 | 74 20 77 61 69 74 69 6e 67 20 66 6f 72 20 64 61 74 61 3c 62 72 3e 0a 20 20 20 20 20 2a 20 62 6c | t.waiting.for.data<br>......*.bl |
2240 | 6f 63 6b 65 64 20 28 62 6f 6f 6c 29 20 2d 20 54 68 65 20 73 6f 63 6b 65 74 20 77 61 73 20 62 6c | ocked.(bool).-.The.socket.was.bl |
2260 | 6f 63 6b 65 64 3c 62 72 3e 0a 20 20 20 20 20 2a 20 65 6f 66 20 28 62 6f 6f 6c 29 20 2d 20 49 6e | ocked<br>......*.eof.(bool).-.In |
2280 | 64 69 63 61 74 65 73 20 45 4f 46 20 65 76 65 6e 74 3c 62 72 3e 0a 20 20 20 20 20 2a 20 75 6e 72 | dicates.EOF.event<br>......*.unr |
22a0 | 65 61 64 5f 62 79 74 65 73 20 28 69 6e 74 29 20 2d 20 4e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 | ead_bytes.(int).-.Number.of.byte |
22c0 | 73 20 6c 65 66 74 20 69 6e 20 74 68 65 20 73 6f 63 6b 65 74 20 62 75 66 66 65 72 3c 62 72 3e 0a | s.left.in.the.socket.buffer<br>. |
22e0 | 20 20 20 20 20 2a 20 3c 2f 70 3e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 | .....*.</p>......*......*.@acces |
2300 | 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 41 72 | s.public......*.@return.mixed.Ar |
2320 | 72 61 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 | ray.containing.information.about |
2340 | 20 65 78 69 73 74 69 6e 67 20 73 6f 63 6b 65 74 20 72 65 73 6f 75 72 63 65 20 6f 72 20 61 6e 20 | .existing.socket.resource.or.an. |
2360 | 65 72 72 6f 72 20 6f 62 6a 65 63 74 20 6f 74 68 65 72 77 69 73 65 0a 20 20 20 20 20 2a 2f 0a 20 | error.object.otherwise......*/.. |
2380 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 53 74 61 74 75 73 28 29 20 7b 0a 20 20 20 20 20 20 | ...function.getStatus().{....... |
23a0 | 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a | ..if.(is_resource($this->fp)).{. |
23c0 | 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 6f 63 6b 65 74 5f 67 65 74 5f 73 74 | ............return.socket_get_st |
23e0 | 61 74 75 73 28 24 74 68 69 73 2d 3e 66 70 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 | atus($this->fp);.........}...... |
2400 | 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 | ...return.$this->raiseError("not |
2420 | 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 | .connected");.....}.....//.}}}.. |
2440 | 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 67 65 74 73 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 | ........//.{{{.gets()...../**... |
2460 | 20 20 20 2a 20 47 65 74 20 61 20 73 70 65 63 69 66 69 65 64 20 6c 69 6e 65 20 6f 66 20 64 61 74 | ...*.Get.a.specified.line.of.dat |
2480 | 61 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 | a......*......*.@access.public.. |
24a0 | 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 24 73 69 7a 65 20 62 79 74 65 73 20 6f 66 20 64 61 74 | ....*.@return.$size.bytes.of.dat |
24c0 | 61 20 66 72 6f 6d 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 | a.from.the.socket,.or.a.PEAR_Err |
24e0 | 6f 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 | or.if......*.........not.connect |
2500 | 65 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 73 28 24 73 | ed.......*/.....function.gets($s |
2520 | 69 7a 65 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 | ize).{.........if.(is_resource($ |
2540 | 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | this->fp)).{.............return. |
2560 | 66 67 65 74 73 28 24 74 68 69 73 2d 3e 66 70 2c 20 24 73 69 7a 65 29 3b 0a 20 20 20 20 20 20 20 | fgets($this->fp,.$size);........ |
2580 | 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 | .}.........return.$this->raiseEr |
25a0 | 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 | ror("not.connected");.....}..... |
25c0 | 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 64 28 29 0a 20 20 | //.}}}..........//.{{{.read()... |
25e0 | 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 61 64 20 61 20 73 70 65 63 69 66 69 65 64 20 61 6d | ../**......*.Read.a.specified.am |
2600 | 6f 75 6e 74 20 6f 66 20 64 61 74 61 2e 20 54 68 69 73 20 69 73 20 67 75 61 72 61 6e 74 65 65 64 | ount.of.data..This.is.guaranteed |
2620 | 20 74 6f 20 72 65 74 75 72 6e 2c 0a 20 20 20 20 20 2a 20 61 6e 64 20 68 61 73 20 74 68 65 20 61 | .to.return,......*.and.has.the.a |
2640 | 64 64 65 64 20 62 65 6e 65 66 69 74 20 6f 66 20 67 65 74 74 69 6e 67 20 65 76 65 72 79 74 68 69 | dded.benefit.of.getting.everythi |
2660 | 6e 67 20 69 6e 20 6f 6e 65 20 66 72 65 61 64 28 29 0a 20 20 20 20 20 2a 20 63 68 75 6e 6b 3b 20 | ng.in.one.fread()......*.chunk;. |
2680 | 69 66 20 79 6f 75 20 6b 6e 6f 77 20 74 68 65 20 73 69 7a 65 20 6f 66 20 74 68 65 20 64 61 74 61 | if.you.know.the.size.of.the.data |
26a0 | 20 79 6f 75 27 72 65 20 67 65 74 74 69 6e 67 0a 20 20 20 20 20 2a 20 62 65 66 6f 72 65 68 61 6e | .you're.getting......*.beforehan |
26c0 | 64 2c 20 74 68 69 73 20 69 73 20 64 65 66 69 6e 69 74 65 6c 79 20 74 68 65 20 77 61 79 20 74 6f | d,.this.is.definitely.the.way.to |
26e0 | 20 67 6f 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 24 73 69 7a 65 20 | .go.......*......*.@param.$size. |
2700 | 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 74 6f 20 72 65 61 64 20 66 72 6f 6d | The.number.of.bytes.to.read.from |
2720 | 20 74 68 65 20 73 6f 63 6b 65 74 2e 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c | .the.socket.......*.@access.publ |
2740 | 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 24 73 69 7a 65 20 62 79 74 65 73 20 6f 66 | ic......*.@return.$size.bytes.of |
2760 | 20 64 61 74 61 20 66 72 6f 6d 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 20 61 20 50 45 41 52 | .data.from.the.socket,.or.a.PEAR |
2780 | 5f 45 72 72 6f 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e | _Error.if......*.........not.con |
27a0 | 6e 65 63 74 65 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 | nected.......*/.....function.rea |
27c0 | 64 28 24 73 69 7a 65 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 | d($size).{.........if.(is_resour |
27e0 | 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 | ce($this->fp)).{.............ret |
2800 | 75 72 6e 20 66 72 65 61 64 28 24 74 68 69 73 2d 3e 66 70 2c 20 24 73 69 7a 65 29 3b 0a 20 20 20 | urn.fread($this->fp,.$size);.... |
2820 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 | .....}.........return.$this->rai |
2840 | 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a | seError("not.connected");.....}. |
2860 | 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 77 72 69 74 65 | ....//.}}}..........//.{{{.write |
2880 | 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 57 72 69 74 65 20 61 20 73 70 65 63 69 66 | ()...../**......*.Write.a.specif |
28a0 | 69 65 64 20 61 6d 6f 75 6e 74 20 6f 66 20 64 61 74 61 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 | ied.amount.of.data.......*...... |
28c0 | 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 | *.@access.public......*.@return. |
28e0 | 6d 69 78 65 64 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 20 6f 72 20 61 6e 20 65 72 72 6f | mixed.true.on.success.or.an.erro |
2900 | 72 20 6f 62 6a 65 63 74 20 6f 74 68 65 72 77 69 73 65 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 | r.object.otherwise......*/.....f |
2920 | 75 6e 63 74 69 6f 6e 20 77 72 69 74 65 28 24 64 61 74 61 29 20 7b 0a 20 20 20 20 20 20 20 20 69 | unction.write($data).{.........i |
2940 | 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 | f.(is_resource($this->fp)).{.... |
2960 | 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 77 72 69 74 65 28 24 74 68 69 73 2d 3e 66 70 | .........return.fwrite($this->fp |
2980 | 2c 20 24 64 61 74 61 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 | ,.$data);.........}.........retu |
29a0 | 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 | rn.$this->raiseError("not.connec |
29c0 | 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 | ted");.....}.....//.}}}......... |
29e0 | 20 2f 2f 20 7b 7b 7b 20 77 72 69 74 65 4c 69 6e 65 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 | .//.{{{.writeLine()...../**..... |
2a00 | 20 2a 20 57 72 69 74 65 20 61 20 6c 69 6e 65 20 6f 66 20 64 61 74 61 20 74 6f 20 74 68 65 20 73 | .*.Write.a.line.of.data.to.the.s |
2a20 | 6f 63 6b 65 74 2c 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61 20 74 72 61 69 6c 69 6e 67 20 22 5c | ocket,.followed.by.a.trailing."\ |
2a40 | 72 5c 6e 22 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c | r\n".......*......*.@access.publ |
2a60 | 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 66 70 75 74 73 20 72 65 | ic......*.@return.mixed.fputs.re |
2a80 | 73 75 6c 74 2c 20 6f 72 20 61 6e 20 65 72 72 6f 72 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 | sult,.or.an.error......*/.....fu |
2aa0 | 6e 63 74 69 6f 6e 20 77 72 69 74 65 4c 69 6e 65 20 28 24 64 61 74 61 29 20 7b 0a 20 20 20 20 20 | nction.writeLine.($data).{...... |
2ac0 | 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b | ...if.(is_resource($this->fp)).{ |
2ae0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 77 72 69 74 65 | .............return.$this->write |
2b00 | 28 24 64 61 74 61 20 2e 20 22 5c 72 5c 6e 22 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 | ($data..."\r\n");.........}..... |
2b20 | 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f | ....return.$this->raiseError("no |
2b40 | 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a | t.connected");.....}.....//.}}}. |
2b60 | 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 65 6f 66 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 | .........//.{{{.eof()...../**... |
2b80 | 20 20 20 2a 20 54 65 73 74 73 20 66 6f 72 20 65 6e 64 2d 6f 66 2d 66 69 6c 65 20 6f 6e 20 61 20 | ...*.Tests.for.end-of-file.on.a. |
2ba0 | 73 6f 63 6b 65 74 20 64 65 73 63 72 69 70 74 6f 72 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 | socket.descriptor......*......*. |
2bc0 | 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 62 6f | @access.public......*.@return.bo |
2be0 | 6f 6c 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 65 6f 66 28 29 20 7b 0a | ol......*/.....function.eof().{. |
2c00 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 | ........return.(is_resource($thi |
2c20 | 73 2d 3e 66 70 29 20 26 26 20 66 65 6f 66 28 24 74 68 69 73 2d 3e 66 70 29 29 3b 0a 20 20 20 20 | s->fp).&&.feof($this->fp));..... |
2c40 | 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 | }.....//.}}}..........//.{{{.rea |
2c60 | 64 42 79 74 65 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 61 64 73 20 61 20 62 | dByte()...../**......*.Reads.a.b |
2c80 | 79 74 65 20 6f 66 20 64 61 74 61 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 | yte.of.data......*......*.@acces |
2ca0 | 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 31 20 62 79 74 65 20 6f | s.public......*.@return.1.byte.o |
2cc0 | 66 20 64 61 74 61 20 66 72 6f 6d 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 20 61 20 50 45 41 | f.data.from.the.socket,.or.a.PEA |
2ce0 | 52 5f 45 72 72 6f 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f | R_Error.if......*.........not.co |
2d00 | 6e 6e 65 63 74 65 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 | nnected.......*/.....function.re |
2d20 | 61 64 42 79 74 65 28 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 | adByte().{.........if.(is_resour |
2d40 | 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 | ce($this->fp)).{.............ret |
2d60 | 75 72 6e 20 6f 72 64 28 24 74 68 69 73 2d 3e 72 65 61 64 28 31 29 29 3b 0a 20 20 20 20 20 20 20 | urn.ord($this->read(1));........ |
2d80 | 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 | .}.........return.$this->raiseEr |
2da0 | 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 | ror("not.connected");.....}..... |
2dc0 | 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 64 57 6f 72 64 28 | //.}}}..........//.{{{.readWord( |
2de0 | 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 61 64 73 20 61 20 77 6f 72 64 20 6f 66 | )...../**......*.Reads.a.word.of |
2e00 | 20 64 61 74 61 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c | .data......*......*.@access.publ |
2e20 | 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 31 20 77 6f 72 64 20 6f 66 20 64 61 74 61 | ic......*.@return.1.word.of.data |
2e40 | 20 66 72 6f 6d 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f | .from.the.socket,.or.a.PEAR_Erro |
2e60 | 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 | r.if......*.........not.connecte |
2e80 | 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 57 6f 72 64 | d.......*/.....function.readWord |
2ea0 | 28 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 | ().{.........if.(is_resource($th |
2ec0 | 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 62 75 66 20 3d 20 24 74 | is->fp)).{.............$buf.=.$t |
2ee0 | 68 69 73 2d 3e 72 65 61 64 28 32 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | his->read(2);.............return |
2f00 | 20 28 6f 72 64 28 24 62 75 66 5b 30 5d 29 20 2b 20 28 6f 72 64 28 24 62 75 66 5b 31 5d 29 20 3c | .(ord($buf[0]).+.(ord($buf[1]).< |
2f20 | 3c 20 38 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | <.8));.........}.........return. |
2f40 | 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 | $this->raiseError("not.connected |
2f60 | 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f | ");.....}.....//.}}}..........// |
2f80 | 20 7b 7b 7b 20 72 65 61 64 49 6e 74 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 | .{{{.readInt()...../**......*.Re |
2fa0 | 61 64 73 20 61 6e 20 69 6e 74 20 6f 66 20 64 61 74 61 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a | ads.an.int.of.data......*......* |
2fc0 | 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 31 | .@access.public......*.@return.1 |
2fe0 | 20 69 6e 74 20 6f 66 20 64 61 74 61 20 66 72 6f 6d 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 | .int.of.data.from.the.socket,.or |
3000 | 20 61 20 50 45 41 52 5f 45 72 72 6f 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 | .a.PEAR_Error.if......*......... |
3020 | 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 | not.connected.......*/.....funct |
3040 | 69 6f 6e 20 72 65 61 64 49 6e 74 28 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 | ion.readInt().{.........if.(is_r |
3060 | 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | esource($this->fp)).{........... |
3080 | 20 20 24 62 75 66 20 3d 20 24 74 68 69 73 2d 3e 72 65 61 64 28 34 29 3b 0a 20 20 20 20 20 20 20 | ..$buf.=.$this->read(4);........ |
30a0 | 20 20 20 20 20 72 65 74 75 72 6e 20 28 6f 72 64 28 24 62 75 66 5b 30 5d 29 20 2b 20 28 6f 72 64 | .....return.(ord($buf[0]).+.(ord |
30c0 | 28 24 62 75 66 5b 31 5d 29 20 3c 3c 20 38 29 20 2b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ($buf[1]).<<.8).+............... |
30e0 | 20 20 20 20 20 20 28 6f 72 64 28 24 62 75 66 5b 32 5d 29 20 3c 3c 20 31 36 29 20 2b 20 28 6f 72 | ......(ord($buf[2]).<<.16).+.(or |
3100 | 64 28 24 62 75 66 5b 33 5d 29 20 3c 3c 20 32 34 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 | d($buf[3]).<<.24));.........}... |
3120 | 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 | ......return.$this->raiseError(" |
3140 | 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d | not.connected");.....}.....//.}} |
3160 | 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 64 53 74 72 69 6e 67 28 29 0a 20 | }..........//.{{{.readString().. |
3180 | 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 61 64 73 20 61 20 7a 65 72 6f 74 65 72 6d 69 6e | .../**......*.Reads.a.zerotermin |
31a0 | 61 74 65 64 20 73 74 72 69 6e 67 20 6f 66 20 64 61 74 61 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 | ated.string.of.data......*...... |
31c0 | 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 | *.@access.public......*.@return. |
31e0 | 73 74 72 69 6e 67 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f 72 20 69 66 0a 20 20 20 20 20 | string,.or.a.PEAR_Error.if...... |
3200 | 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 2e 0a 20 20 20 20 20 2a 2f | *.........not.connected.......*/ |
3220 | 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 53 74 72 69 6e 67 28 29 20 7b 0a 20 20 20 | .....function.readString().{.... |
3240 | 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 | .....if.(is_resource($this->fp)) |
3260 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 20 3d 20 27 27 3b 0a 20 20 20 | .{.............$string.=.'';.... |
3280 | 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 28 24 63 68 61 72 20 3d 20 24 74 68 69 73 2d 3e | .........while.(($char.=.$this-> |
32a0 | 72 65 61 64 28 31 29 29 20 21 3d 20 22 5c 78 30 30 22 29 20 20 7b 0a 20 20 20 20 20 20 20 20 20 | read(1)).!=."\x00")..{.......... |
32c0 | 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 20 2e 3d 20 24 63 68 61 72 3b 0a 20 20 20 20 20 20 20 | .......$string..=.$char;........ |
32e0 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 73 74 72 69 6e | .....}.............return.$strin |
3300 | 67 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 | g;.........}.........return.$thi |
3320 | 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a | s->raiseError("not.connected");. |
3340 | 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b | ....}.....//.}}}..........//.{{{ |
3360 | 20 72 65 61 64 49 50 41 64 64 72 65 73 73 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 | .readIPAddress()...../**......*. |
3380 | 52 65 61 64 73 20 61 6e 20 49 50 20 41 64 64 72 65 73 73 20 61 6e 64 20 72 65 74 75 72 6e 73 20 | Reads.an.IP.Address.and.returns. |
33a0 | 69 74 20 69 6e 20 61 20 64 6f 74 20 66 6f 72 6d 61 74 65 64 20 73 74 72 69 6e 67 0a 20 20 20 20 | it.in.a.dot.formated.string..... |
33c0 | 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 | .*......*.@access.public......*. |
33e0 | 40 72 65 74 75 72 6e 20 44 6f 74 20 66 6f 72 6d 61 74 65 64 20 73 74 72 69 6e 67 2c 20 6f 72 20 | @return.Dot.formated.string,.or. |
3400 | 61 20 50 45 41 52 5f 45 72 72 6f 72 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e | a.PEAR_Error.if......*.........n |
3420 | 6f 74 20 63 6f 6e 6e 65 63 74 65 64 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 | ot.connected.......*/.....functi |
3440 | 6f 6e 20 72 65 61 64 49 50 41 64 64 72 65 73 73 28 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 | on.readIPAddress().{.........if. |
3460 | 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 | (is_resource($this->fp)).{...... |
3480 | 20 20 20 20 20 20 20 24 62 75 66 20 3d 20 24 74 68 69 73 2d 3e 72 65 61 64 28 34 29 3b 0a 20 20 | .......$buf.=.$this->read(4);... |
34a0 | 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 70 72 69 6e 74 66 28 22 25 73 2e 25 73 2e | ..........return.sprintf("%s.%s. |
34c0 | 25 73 2e 25 73 22 2c 20 6f 72 64 28 24 62 75 66 5b 30 5d 29 2c 20 6f 72 64 28 24 62 75 66 5b 31 | %s.%s",.ord($buf[0]),.ord($buf[1 |
34e0 | 5d 29 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f | ]),............................o |
3500 | 72 64 28 24 62 75 66 5b 32 5d 29 2c 20 6f 72 64 28 24 62 75 66 5b 33 5d 29 29 3b 0a 20 20 20 20 | rd($buf[2]),.ord($buf[3]));..... |
3520 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 | ....}.........return.$this->rais |
3540 | 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 | eError("not.connected");.....}.. |
3560 | 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 64 4c 69 | ...//.}}}..........//.{{{.readLi |
3580 | 6e 65 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 52 65 61 64 20 75 6e 74 69 6c 20 65 | ne()...../**......*.Read.until.e |
35a0 | 69 74 68 65 72 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 73 6f 63 6b 65 74 20 6f 72 20 61 | ither.the.end.of.the.socket.or.a |
35c0 | 20 6e 65 77 6c 69 6e 65 2c 20 77 68 69 63 68 65 76 65 72 0a 20 20 20 20 20 2a 20 63 6f 6d 65 73 | .newline,.whichever......*.comes |
35e0 | 20 66 69 72 73 74 2e 20 53 74 72 69 70 73 20 74 68 65 20 74 72 61 69 6c 69 6e 67 20 6e 65 77 6c | .first..Strips.the.trailing.newl |
3600 | 69 6e 65 20 66 72 6f 6d 20 74 68 65 20 72 65 74 75 72 6e 65 64 20 64 61 74 61 2e 0a 20 20 20 20 | ine.from.the.returned.data...... |
3620 | 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 | .*......*.@access.public......*. |
3640 | 40 72 65 74 75 72 6e 20 41 6c 6c 20 61 76 61 69 6c 61 62 6c 65 20 64 61 74 61 20 75 70 20 74 6f | @return.All.available.data.up.to |
3660 | 20 61 20 6e 65 77 6c 69 6e 65 2c 20 77 69 74 68 6f 75 74 20 74 68 61 74 0a 20 20 20 20 20 2a 20 | .a.newline,.without.that......*. |
3680 | 20 20 20 20 20 20 20 20 6e 65 77 6c 69 6e 65 2c 20 6f 72 20 75 6e 74 69 6c 20 74 68 65 20 65 6e | ........newline,.or.until.the.en |
36a0 | 64 20 6f 66 20 74 68 65 20 73 6f 63 6b 65 74 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f 72 | d.of.the.socket,.or.a.PEAR_Error |
36c0 | 20 69 66 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 | .if......*.........not.connected |
36e0 | 2e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 4c 69 6e 65 28 | .......*/.....function.readLine( |
3700 | 29 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 | ).{.........if.(is_resource($thi |
3720 | 73 2d 3e 66 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6c 69 6e 65 20 3d 20 27 27 | s->fp)).{.............$line.=.'' |
3740 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 69 6d 65 6f 75 74 20 3d 20 74 69 6d 65 28 29 20 | ;.............$timeout.=.time(). |
3760 | 2b 20 24 74 68 69 73 2d 3e 74 69 6d 65 6f 75 74 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 | +.$this->timeout;.............wh |
3780 | 69 6c 65 20 28 21 24 74 68 69 73 2d 3e 65 6f 66 28 29 20 26 26 20 28 21 24 74 68 69 73 2d 3e 74 | ile.(!$this->eof().&&.(!$this->t |
37a0 | 69 6d 65 6f 75 74 20 7c 7c 20 74 69 6d 65 28 29 20 3c 20 24 74 69 6d 65 6f 75 74 29 29 20 7b 0a | imeout.||.time().<.$timeout)).{. |
37c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6c 69 6e 65 20 2e 3d 20 24 74 68 69 73 2d 3e | ................$line..=.$this-> |
37e0 | 67 65 74 73 28 24 74 68 69 73 2d 3e 6c 69 6e 65 4c 65 6e 67 74 68 29 3b 0a 20 20 20 20 20 20 20 | gets($this->lineLength);........ |
3800 | 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 6c 65 6e 28 24 6c 69 6e 65 29 20 3e 3d 20 32 20 | .........if.(strlen($line).>=.2. |
3820 | 26 26 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 73 75 62 73 74 72 28 24 | &&.....................(substr($ |
3840 | 6c 69 6e 65 2c 20 2d 32 29 20 3d 3d 20 22 5c 72 5c 6e 22 20 7c 7c 0a 20 20 20 20 20 20 20 20 20 | line,.-2).==."\r\n".||.......... |
3860 | 20 20 20 20 20 20 20 20 20 20 20 20 73 75 62 73 74 72 28 24 6c 69 6e 65 2c 20 2d 31 29 20 3d 3d | ............substr($line,.-1).== |
3880 | 20 22 5c 6e 22 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 | ."\n")).{.....................re |
38a0 | 74 75 72 6e 20 72 74 72 69 6d 28 24 6c 69 6e 65 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | turn.rtrim($line);.............. |
38c0 | 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 | ...}.............}.............r |
38e0 | 65 74 75 72 6e 20 24 6c 69 6e 65 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 | eturn.$line;.........}.........r |
3900 | 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e 6f 74 20 63 6f 6e | eturn.$this->raiseError("not.con |
3920 | 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d 0a 20 20 20 20 0a | nected");.....}.....//.}}}...... |
3940 | 20 20 20 20 2f 2f 20 7b 7b 7b 20 72 65 61 64 41 6c 6c 28 29 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 | ....//.{{{.readAll()...../**.... |
3960 | 20 20 2a 20 52 65 61 64 20 75 6e 74 69 6c 20 74 68 65 20 73 6f 63 6b 65 74 20 63 6c 6f 73 65 73 | ..*.Read.until.the.socket.closes |
3980 | 2e 20 54 48 49 53 20 46 55 4e 43 54 49 4f 4e 20 57 49 4c 4c 20 4e 4f 54 20 45 58 49 54 20 69 66 | ..THIS.FUNCTION.WILL.NOT.EXIT.if |
39a0 | 20 74 68 65 0a 20 20 20 20 20 2a 20 73 6f 63 6b 65 74 20 69 73 20 69 6e 20 62 6c 6f 63 6b 69 6e | .the......*.socket.is.in.blockin |
39c0 | 67 20 6d 6f 64 65 20 75 6e 74 69 6c 20 74 68 65 20 73 6f 63 6b 65 74 20 63 6c 6f 73 65 73 2e 0a | g.mode.until.the.socket.closes.. |
39e0 | 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 | .....*......*.@access.public.... |
3a00 | 20 20 2a 20 40 72 65 74 75 72 6e 20 41 6c 6c 20 64 61 74 61 20 75 6e 74 69 6c 20 74 68 65 20 73 | ..*.@return.All.data.until.the.s |
3a20 | 6f 63 6b 65 74 20 63 6c 6f 73 65 73 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f 72 20 69 66 | ocket.closes,.or.a.PEAR_Error.if |
3a40 | 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 2e 0a 20 | ......*.........not.connected... |
3a60 | 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 41 6c 6c 28 29 20 7b 0a | ....*/.....function.readAll().{. |
3a80 | 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 72 65 73 6f 75 72 63 65 28 24 74 68 69 73 2d 3e 66 | ........if.(is_resource($this->f |
3aa0 | 70 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 64 61 74 61 20 3d 20 27 27 3b 0a 20 20 | p)).{.............$data.=.'';... |
3ac0 | 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 21 24 74 68 69 73 2d 3e 65 6f 66 28 29 29 0a | ..........while.(!$this->eof()). |
3ae0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 64 61 74 61 20 2e 3d 20 24 74 68 69 73 2d 3e | ................$data..=.$this-> |
3b00 | 72 65 61 64 28 24 74 68 69 73 2d 3e 6c 69 6e 65 4c 65 6e 67 74 68 29 3b 0a 20 20 20 20 20 20 20 | read($this->lineLength);........ |
3b20 | 20 20 20 20 20 72 65 74 75 72 6e 20 24 64 61 74 61 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | .....return.$data;.........}.... |
3b40 | 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 22 6e | .....return.$this->raiseError("n |
3b60 | 6f 74 20 63 6f 6e 6e 65 63 74 65 64 22 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 2f 2f 20 7d 7d 7d | ot.connected");.....}.....//.}}} |
3b80 | 0a 20 20 20 20 0a 7d 0a 3f 3e 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ......}.?>...................... |
3ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3ca0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3cc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3ce0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3d00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3d20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3d40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3d60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3d80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3da0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3dc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3de0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |