added Socket::sendx() functions
added SocketAddress::set() that accepts a string fixed a bug in nwad-skad.c
This commit is contained in:
@ -503,6 +503,12 @@
|
||||
/* Define to 1 if you have the `readdir64' function. */
|
||||
#undef HAVE_READDIR64
|
||||
|
||||
/* Define to 1 if you have the `readv' function. */
|
||||
#undef HAVE_READV
|
||||
|
||||
/* Define to 1 if you have the `recvmsg' function. */
|
||||
#undef HAVE_RECVMSG
|
||||
|
||||
/* Define to 1 if you have the `round' function. */
|
||||
#undef HAVE_ROUND
|
||||
|
||||
@ -530,6 +536,9 @@
|
||||
/* Define to 1 if you have the `sendfilev64' function. */
|
||||
#undef HAVE_SENDFILEV64
|
||||
|
||||
/* Define to 1 if you have the `sendmsg' function. */
|
||||
#undef HAVE_SENDMSG
|
||||
|
||||
/* Define to 1 if you have the `setcontext' function. */
|
||||
#undef HAVE_SETCONTEXT
|
||||
|
||||
@ -832,6 +841,9 @@
|
||||
/* This value is set to 1 to indicate that the system argz facility works */
|
||||
#undef HAVE_WORKING_ARGZ
|
||||
|
||||
/* Define to 1 if you have the `writev' function. */
|
||||
#undef HAVE_WRITEV
|
||||
|
||||
/* Define to 1 if you have the `_vsnprintf' function. */
|
||||
#undef HAVE__VSNPRINTF
|
||||
|
||||
@ -872,12 +884,33 @@
|
||||
/* Define if dlsym() requires a leading underscore in symbol names. */
|
||||
#undef NEED_USCORE
|
||||
|
||||
/* The size of `AF_INET', as computed by valueof. */
|
||||
#undef NUMVALOF_AF_INET
|
||||
|
||||
/* The size of `AF_INET6', as computed by valueof. */
|
||||
#undef NUMVALOF_AF_INET6
|
||||
|
||||
/* The size of `AF_PACKET', as computed by valueof. */
|
||||
#undef NUMVALOF_AF_PACKET
|
||||
|
||||
/* The size of `AF_UNIX', as computed by valueof. */
|
||||
#undef NUMVALOF_AF_UNIX
|
||||
|
||||
/* The size of `MB_LEN_MAX', as computed by valueof. */
|
||||
#undef NUMVALOF_MB_LEN_MAX
|
||||
|
||||
/* The size of `PATH_MAX', as computed by valueof. */
|
||||
#undef NUMVALOF_PATH_MAX
|
||||
|
||||
/* The size of `SOCK_DGRAM', as computed by valueof. */
|
||||
#undef NUMVALOF_SOCK_DGRAM
|
||||
|
||||
/* The size of `SOCK_RAW', as computed by valueof. */
|
||||
#undef NUMVALOF_SOCK_RAW
|
||||
|
||||
/* The size of `SOCK_STREAM', as computed by valueof. */
|
||||
#undef NUMVALOF_SOCK_STREAM
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
@ -903,6 +936,18 @@
|
||||
your system. */
|
||||
#undef PTHREAD_CREATE_JOINABLE
|
||||
|
||||
/* AF_INET */
|
||||
#undef QSE_AF_INET
|
||||
|
||||
/* AF_INET6 */
|
||||
#undef QSE_AF_INET6
|
||||
|
||||
/* AF_PACKET */
|
||||
#undef QSE_AF_PACKET
|
||||
|
||||
/* AF_UNIX */
|
||||
#undef QSE_AF_UNIX
|
||||
|
||||
/* The default character type is the multi-byte character type */
|
||||
#undef QSE_CHAR_IS_MCHAR
|
||||
|
||||
@ -936,6 +981,12 @@
|
||||
/* Define if mode_t is signed */
|
||||
#undef QSE_MODE_T_IS_SIGNED
|
||||
|
||||
/* offsetof(struct iovec, iov_base) */
|
||||
#undef QSE_OFFSETOF_IOV_BASE
|
||||
|
||||
/* offsetof(struct iovec, iov_len) */
|
||||
#undef QSE_OFFSETOF_IOV_LEN
|
||||
|
||||
/* offsetof(struct sockaddr, sa_family) */
|
||||
#undef QSE_OFFSETOF_SA_FAMILY
|
||||
|
||||
@ -1023,6 +1074,9 @@
|
||||
/* sizeof(socklen_t) */
|
||||
#undef QSE_SIZEOF_SOCKLEN_T
|
||||
|
||||
/* sizeof(struct iovec) */
|
||||
#undef QSE_SIZEOF_STRUCT_IOVEC
|
||||
|
||||
/* sizeof(struct sockaddr_dl) */
|
||||
#undef QSE_SIZEOF_STRUCT_SOCKADDR_DL
|
||||
|
||||
@ -1068,6 +1122,15 @@
|
||||
/* Define if socklen_t is signed */
|
||||
#undef QSE_SOCKLEN_T_IS_SIGNED
|
||||
|
||||
/* SOCK_DGRAM */
|
||||
#undef QSE_SOCK_DGRAM
|
||||
|
||||
/* SOCK_RAW */
|
||||
#undef QSE_SOCK_RAW
|
||||
|
||||
/* SOCK_STREAM */
|
||||
#undef QSE_SOCK_STREAM
|
||||
|
||||
/* use qse_fltmax_t for floating-point numbers in AWK */
|
||||
#undef QSE_USE_AWK_FLTMAX
|
||||
|
||||
@ -1131,6 +1194,9 @@
|
||||
/* The size of `socklen_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SOCKLEN_T
|
||||
|
||||
/* The size of `struct iovec', as computed by sizeof. */
|
||||
#undef SIZEOF_STRUCT_IOVEC
|
||||
|
||||
/* The size of `struct sockaddr_dl', as computed by sizeof. */
|
||||
#undef SIZEOF_STRUCT_SOCKADDR_DL
|
||||
|
||||
|
@ -76,15 +76,22 @@ public:
|
||||
int open (int domain, int type, int protocol, int traits = 0) QSE_CPP_NOEXCEPT;
|
||||
void close () QSE_CPP_NOEXCEPT;
|
||||
|
||||
|
||||
int connect (const SocketAddress& target) QSE_CPP_NOEXCEPT;
|
||||
int bind (const SocketAddress& target) QSE_CPP_NOEXCEPT;
|
||||
int listen (int backlog) QSE_CPP_NOEXCEPT;
|
||||
int accept (Socket* newsck, SocketAddress* newaddr, int traits = 0) QSE_CPP_NOEXCEPT;
|
||||
|
||||
// The send() functions sends data by attemping a single call to the
|
||||
// underlying system calls
|
||||
qse_ssize_t send (const void* buf, qse_size_t len) QSE_CPP_NOEXCEPT;
|
||||
qse_ssize_t send (const void* buf, qse_size_t len, const SocketAddress& dstaddr) QSE_CPP_NOEXCEPT;
|
||||
|
||||
// The sendx() functions sends data as much as it can, possibly with multiple
|
||||
// underlying system calls.
|
||||
int sendx (const void* buf, qse_size_t len, qse_size_t* total_sent = QSE_NULL) QSE_CPP_NOEXCEPT;
|
||||
int sendx (const void* buf, qse_size_t len, const SocketAddress& dstaddr, qse_size_t* total_sent = QSE_NULL) QSE_CPP_NOEXCEPT;
|
||||
int sendx (qse_ioptl_t* vec, int count, qse_size_t* total_sent = QSE_NULL) QSE_CPP_NOEXCEPT;
|
||||
|
||||
qse_ssize_t receive (void* buf, qse_size_t len) QSE_CPP_NOEXCEPT;
|
||||
qse_ssize_t receive (void* buf, qse_size_t len, SocketAddress& srcaddr) QSE_CPP_NOEXCEPT;
|
||||
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
|
||||
int set (const qse_skad_t* skad);
|
||||
int set (const qse_nwad_t* nwad);
|
||||
int set (const qse_mchar_t* str);
|
||||
int set (const qse_wchar_t* str);
|
||||
|
||||
protected:
|
||||
qse_skad_t skad;
|
||||
|
@ -762,6 +762,29 @@ struct qse_xptl_t
|
||||
};
|
||||
typedef struct qse_xptl_t qse_xptl_t;
|
||||
|
||||
/**
|
||||
* The qse_ioptl_t type defines an analogus type to 'struct iovec' typically
|
||||
* found on posix platforms
|
||||
*/
|
||||
#if (QSE_SIZEOF_STRUCT_IOVEC > 0) && (QSE_OFFSETOF_IOV_BASE != QSE_OFFSETOF_IOV_LEN)
|
||||
struct qse_ioptl_t
|
||||
{
|
||||
/* [THINK] do i have to go extreme to inject fillers by looking at the total size and the offsets ?
|
||||
* i believe most systems should define only two members - iovec_base and iovec_len */
|
||||
#if (QSE_OFFSETOF_IOV_BASE < QSE_OFFSETOF_IOV_LEN)
|
||||
void* ptr;
|
||||
qse_size_t len;
|
||||
#else
|
||||
qse_size_t len;
|
||||
void* ptr;
|
||||
#endif
|
||||
};
|
||||
typedef struct qse_ioptl_t qse_ioptl_t;
|
||||
#else
|
||||
typedef qse_xptl_t qse_ioptl_t;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* The qse_floc_t type defines a structure that can hold a position
|
||||
* in a file.
|
||||
|
Reference in New Issue
Block a user