2019-07-28 10:31:56 +08:00
|
|
|
|
#ifndef ACL_CONNECT_INCLUDE_H
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#define ACL_CONNECT_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../stdlib/acl_define.h"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
#ifdef ACL_UNIX
|
2018-01-14 22:54:44 +08:00
|
|
|
|
#include <sys/types.h>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
#include <sys/socket.h>
|
2023-11-22 11:05:30 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define ACL_CONNECT_F_NONE 0 /* Nonthing */
|
|
|
|
|
#define ACL_CONNECT_F_SYS_ERR (1 << 0) /* <20><><EFBFBD><EFBFBD>ϵͳ errno */
|
|
|
|
|
#define ACL_CONNECT_F_CREATE_SOCKET_ERR (1 << 1) /* <20><><EFBFBD><EFBFBD> socket <20><><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_REUSE_ADDR_ERR (1 << 2) /* <20>ظ<EFBFBD>ʹ<EFBFBD>ð<C3B0>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_BIND_IP_OK (1 << 3) /* <20><EFBFBD><F3B6A8B1><EFBFBD> IP <20>ɹ<EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_BIND_IP_ERR (1 << 4) /* <20><EFBFBD><F3B6A8B1><EFBFBD> IP ʧ<><CAA7> */
|
|
|
|
|
#define ACL_CONNECT_F_BIND_IFACE_OK (1 << 5) /* <20><EFBFBD><F3B6A8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_BIND_IFACE_ERR (1 << 6) /* <20><EFBFBD><F3B6A8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> */
|
|
|
|
|
#define ACL_CONNECT_F_SO_ERROR (1 << 7) /* socket <20><><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_INPROGRESS (1 << 8); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
#define ACL_CONNECT_F_WAIT_ERR (1 << 9) /* <20>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD>ӽ<EFBFBD><D3BD><EFBFBD>ʧ<EFBFBD><CAA7> */
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/* in acl_sane_connect.c */
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param sock {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD>UNIXƽ̨<EFBFBD>»<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param sa {const struct sockaddr*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @param len {socklen_t} sa <EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {int} 0: <EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD>; -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_sane_connect(ACL_SOCKET sock, const struct sockaddr * sa,
|
|
|
|
|
socklen_t len);
|
|
|
|
|
|
|
|
|
|
/* in acl_timed_connect.c */
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param fd {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD>UNIXƽ̨<EFBFBD>»<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param sa {const struct sockaddr*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @param len {socklen_t} sa <EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2021-07-09 18:27:11 +08:00
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD>뼶)
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} 0: <EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD>; -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_timed_connect(ACL_SOCKET fd, const struct sockaddr * sa,
|
|
|
|
|
socklen_t len, int timeout);
|
|
|
|
|
|
2021-07-09 18:27:11 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param fd {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD>֣<EFBFBD><EFBFBD><EFBFBD>UNIXƽ̨<EFBFBD>»<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param sa {const struct sockaddr*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @param len {socklen_t} sa <EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>뼶)
|
2023-11-22 11:05:30 +08:00
|
|
|
|
* @param flags {unsigned*} <EFBFBD>ǿ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
2021-07-09 18:27:11 +08:00
|
|
|
|
* @return {int} 0: <EFBFBD><EFBFBD><EFBFBD>ӳɹ<EFBFBD>; -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
2023-11-22 11:05:30 +08:00
|
|
|
|
ACL_API int acl_timed_connect_ms2(ACL_SOCKET fd, const struct sockaddr * sa,
|
|
|
|
|
socklen_t len, int timeout, unsigned *flags);
|
2021-07-09 18:27:11 +08:00
|
|
|
|
ACL_API int acl_timed_connect_ms(ACL_SOCKET fd, const struct sockaddr * sa,
|
|
|
|
|
socklen_t len, int timeout);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
/* in acl_inet_connect.c */
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
2020-06-27 14:01:13 +08:00
|
|
|
|
* @param addr {const char*} Զ<EFBFBD>̷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>磺192.168.0.1|80, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* Ҫ<EFBFBD><EFBFBD><EFBFBD>صĵ<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽΪ: remote_addr@local_ip,
|
|
|
|
|
* <EFBFBD><EFBFBD>: www.sina.com|80@60.28.250.199
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param blocking {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ, ACL_BLOCKING <EFBFBD><EFBFBD> ACL_NON_BLOCKING
|
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD> blocking Ϊ ACL_NON_BLOCKING <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL_SOCKET_INVALID <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2017-04-07 20:13:08 +08:00
|
|
|
|
ACL_API ACL_SOCKET acl_inet_connect(const char *addr, int blocking, int timeout);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
2020-06-27 14:01:13 +08:00
|
|
|
|
* @param addr {const char*} Զ<EFBFBD>̷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>磺192.168.0.1|80<EFBFBD><EFBFBD>
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>
|
2020-06-27 14:01:13 +08:00
|
|
|
|
* remote_ip|remote_port@local_ip<EFBFBD><EFBFBD><EFBFBD>磺211.150.111.12|80@192.168.1.1
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param blocking {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ, ACL_BLOCKING <EFBFBD><EFBFBD> ACL_NON_BLOCKING
|
2021-07-09 18:27:11 +08:00
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD>뼶)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> blocking Ϊ ACL_NON_BLOCKING <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2023-11-22 11:05:30 +08:00
|
|
|
|
* @param flags {unsigned*} <EFBFBD>ǿ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
|
|
|
|
* @return {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL_SOCKET_INVALID <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2023-11-22 11:05:30 +08:00
|
|
|
|
ACL_API ACL_SOCKET acl_inet_connect2(const char *addr, int blocking,
|
|
|
|
|
int timeout, unsigned *flags);
|
|
|
|
|
#define acl_inet_connect_ex acl_inet_connect2
|
2021-07-09 18:27:11 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
|
|
|
|
|
* @param addr {const char*} Զ<EFBFBD>̷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>磺192.168.0.1|80<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ĵ<EFBFBD>ַ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>
|
2023-11-18 14:53:25 +08:00
|
|
|
|
* remote_ip|remote_port@local_ip <EFBFBD><EFBFBD> remote_ip|remote_port#local_ipinterface<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD>磺
|
2023-11-17 18:49:11 +08:00
|
|
|
|
* 211.150.111.12|80@192.168.1.1
|
2023-11-18 14:53:25 +08:00
|
|
|
|
* 211.150.111.12|80#interface
|
2021-07-09 18:27:11 +08:00
|
|
|
|
* @param blocking {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ, ACL_BLOCKING <EFBFBD><EFBFBD> ACL_NON_BLOCKING
|
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>뼶)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> blocking Ϊ ACL_NON_BLOCKING <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2023-11-22 11:05:30 +08:00
|
|
|
|
* @param flags {unsigned*} <EFBFBD>ǿ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܵĴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ
|
2021-07-09 18:27:11 +08:00
|
|
|
|
* @return {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL_SOCKET_INVALID <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API ACL_SOCKET acl_inet_timed_connect(const char *addr, int blocking,
|
2023-11-22 11:05:30 +08:00
|
|
|
|
int timeout, unsigned *flags);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
#ifdef ACL_UNIX
|
|
|
|
|
|
|
|
|
|
/* in acl_unix_connect.c */
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>Ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2020-06-27 14:01:13 +08:00
|
|
|
|
* @param addr {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȫ·<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD>: /tmp/test.sock<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Linux ƽ̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸΪ @ <EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD> UNIX <EFBFBD><EFBFBD><EFBFBD>ӿڽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param blocking {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ, ACL_BLOCKING <EFBFBD><EFBFBD> ACL_NON_BLOCKING
|
|
|
|
|
* @param timeout {int} <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>ʱʱ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD> blocking Ϊ ACL_NON_BLOCKING <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {ACL_SOCKET} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACL_SOCKET_INVALID <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
2017-04-07 20:13:08 +08:00
|
|
|
|
ACL_API ACL_SOCKET acl_unix_connect(const char *addr, int blocking, int timeout);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
/* in acl_stream_connect.c */
|
|
|
|
|
#ifdef SUNOS5
|
2017-04-07 20:13:08 +08:00
|
|
|
|
ACL_API int acl_stream_connect(const char *path, int blocking, int timeout);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-01-14 22:54:44 +08:00
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
2018-01-22 18:38:50 +08:00
|
|
|
|
typedef int (WINAPI *acl_connect_fn)(SOCKET, const struct sockaddr*, socklen_t);
|
2018-01-14 22:54:44 +08:00
|
|
|
|
#else
|
|
|
|
|
typedef int (*acl_connect_fn)(int, const struct sockaddr*, socklen_t);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
ACL_API void acl_set_connect(acl_connect_fn fn);
|
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|