PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php:1) in /home/u697396820/domains/smartriegroup.com/public_html/assets/images/partners/logo_69cec45839613.php on line 131
/* +----------------------------------------------------------------------+ | Swoole | +----------------------------------------------------------------------+ | This source file is subject to version 2.0 of the Apache license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.apache.org/licenses/LICENSE-2.0.html | | If you did not receive a copy of the Apache2.0 license and are unable| | to obtain it through the world-wide-web, please send a note to | | license@swoole.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Tianfeng Han | +----------------------------------------------------------------------+ */ #pragma once #include "swoole_api.h" #include "swoole_string.h" #include "swoole_socket.h" #include "swoole_reactor.h" #include "swoole_protocol.h" #include "swoole_proxy.h" namespace swoole { namespace network { class Client { public: int id = 0; long timeout_id = 0; // timeout node id int _sock_type = 0; int _sock_domain = 0; int _protocol = 0; FdType fd_type; bool active = false; bool async = false; bool keep = false; bool destroyed = false; bool http2 = false; bool sleep_ = false; bool wait_dns = false; bool shutdow_rw = false; bool shutdown_read = false; bool shutdown_write = false; bool remove_delay = false; bool closed = false; bool high_watermark = false; bool async_connect = false; /** * one package: length check */ bool open_length_check = false; bool open_eof_check = false; Protocol protocol = {}; Socks5Proxy *socks5_proxy = nullptr; HttpProxy *http_proxy = nullptr; uint32_t reuse_count = 0; const char *server_str = nullptr; const char *server_host = nullptr; int server_port = 0; void *ptr = nullptr; void *params = nullptr; uint8_t server_strlen = 0; double timeout = 0; TimerNode *timer = nullptr; /** * signal interruption */ double interrupt_time = 0; /** * sendto, read only. */ Address server_addr = {}; /** * recvfrom */ Address remote_addr = {}; Socket *socket; void *object = nullptr; String *buffer = nullptr; uint32_t wait_length = 0; uint32_t input_buffer_size = 0; uint32_t buffer_high_watermark = 0; uint32_t buffer_low_watermark = 0; #ifdef SW_USE_OPENSSL bool open_ssl = false; bool ssl_wait_handshake = false; std::shared_ptr ssl_context = nullptr; #endif std::function onConnect = nullptr; std::function onError = nullptr; std::function onReceive = nullptr; std::function onClose = nullptr; std::function onBufferFull = nullptr; std::function onBufferEmpty = nullptr; int (*connect)(Client *cli, const char *host, int port, double _timeout, int sock_flag) = nullptr; ssize_t (*send)(Client *cli, const char *data, size_t length, int flags) = nullptr; int (*sendfile)(Client *cli, const char *filename, off_t offset, size_t length) = nullptr; ssize_t (*recv)(Client *cli, char *data, size_t length, int flags) = nullptr; static void init_reactor(Reactor *reactor); Client(SocketType type, bool async); ~Client(); void set_http_proxy(const std::string &host, int port) { http_proxy = new swoole::HttpProxy; http_proxy->proxy_host = host; http_proxy->proxy_port = port; } Socket *get_socket() { return socket; } SocketType get_socket_type() { return socket->socket_type; } const std::string *get_http_proxy_host_name() { #ifdef SW_USE_OPENSSL if (ssl_context && !ssl_context->tls_host_name.empty()) { return &ssl_context->tls_host_name; } #endif return &http_proxy->target_host; } int sleep(); int wakeup(); int shutdown(int __how); int close(); void destroy(); int socks5_handshake(const char *recv_data, size_t length); #ifdef SW_USE_OPENSSL int enable_ssl_encrypt(); #ifdef SW_SUPPORT_DTLS void enable_dtls(); #endif int ssl_handshake(); int ssl_verify(int allow_self_signed); #endif }; //----------------------------------------Stream--------------------------------------- class Stream { public: String *buffer = nullptr; Client client; bool connected = false; bool cancel = false; int errCode = 0; void *private_data = nullptr; void *private_data_2 = nullptr; long private_data_fd = -1; std::function response = nullptr; int send(const char *data, size_t length); void set_max_length(uint32_t max_length); static inline Stream *create(const char *dst_host, int dst_port, SocketType type) { Stream *stream = new Stream(dst_host, dst_port, type); if (!stream->connected) { delete stream; return nullptr; } else { return stream; } } ~Stream(); static ssize_t recv_blocking(Socket *sock, void *__buf, size_t __len); static void set_protocol(Protocol *protocol); private: Stream(const char *dst_host, int dst_port, SocketType type); }; //----------------------------------------Stream End------------------------------------ class SyncClient { protected: Client client; bool connected = false; bool created; bool async = false; SocketType type; public: SyncClient(SocketType _type, bool _async = false) : client(_type, _async), async(_async), type(_type) { created = client.socket != nullptr; } bool connect(const char *host, int port, double timeout = -1) { if (connected || !created) { return false; } if (client.connect(&client, host, port, timeout, client.socket->is_dgram()) < 0) { return false; } connected = true; return true; } #ifdef SW_USE_OPENSSL bool enable_ssl_encrypt() { if (client.enable_ssl_encrypt() < 0 || client.ssl_handshake() < 0) { return false; } else { return true; } } #endif ssize_t send(const std::string &data) { return client.send(&client, data.c_str(), data.length(), 0); } ssize_t send(const char *buf, size_t len) { return client.send(&client, buf, len, 0); } ssize_t recv(char *buf, size_t len) { return client.recv(&client, buf, len, 0); } bool close() { if (!created || client.closed) { return false; } client.close(); created = false; return true; } virtual ~SyncClient() { if (created) { close(); } } }; class AsyncClient : public SyncClient { protected: std::function _onConnect = nullptr; std::function _onError = nullptr; std::function _onClose = nullptr; std::function _onReceive = nullptr; public: AsyncClient(SocketType _type) : SyncClient(_type, true) {} bool connect(const char *host, int port, double timeout = -1) { client.object = this; client.onConnect = [](Client *cli) { AsyncClient *ac = (AsyncClient *) cli->object; ac->_onConnect(ac); }; client.onError = [](Client *cli) { AsyncClient *ac = (AsyncClient *) cli->object; ac->_onError(ac); }; client.onClose = [](Client *cli) { AsyncClient *ac = (AsyncClient *) cli->object; ac->_onClose(ac); }; client.onReceive = [](Client *cli, const char *data, size_t length) { AsyncClient *ac = (AsyncClient *) cli->object; ac->_onReceive(ac, data, length); }; return SyncClient::connect(host, port, timeout); } void on_connect(std::function fn) { _onConnect = fn; } void on_error(std::function fn) { _onError = fn; } void on_close(std::function fn) { _onClose = fn; } void on_receive(std::function fn) { _onReceive = fn; } }; } // namespace network } // namespace swoole