adding mio_dev_timedwritev()

This commit is contained in:
hyung-hwan 2020-02-21 16:58:41 +00:00
parent ef50d2458b
commit 052e10694d
4 changed files with 40 additions and 0 deletions

View File

@ -463,6 +463,17 @@ MIO_EXPORT int mio_dev_sck_timedwrite (
const mio_skad_t* dstaddr
);
MIO_EXPORT int mio_dev_sck_timedwritev (
mio_dev_sck_t* dev,
const mio_iovec_t* iov,
mio_iolen_t iovcnt,
const mio_ntime_t* tmout,
void* wrctx,
const mio_skad_t* dstaddr
);
#if defined(MIO_HAVE_INLINE)
static MIO_INLINE void mio_dev_sck_kill (mio_dev_sck_t* sck)

View File

@ -1279,6 +1279,12 @@ int mio_dev_timedwrite (mio_dev_t* dev, const void* data, mio_iolen_t len, const
return __dev_write(dev, data, len, tmout, wrctx, dstaddr);
}
int mio_dev_timedwritev (mio_dev_t* dev, const mio_iovec_t* iov, mio_iolen_t iovcnt, const mio_ntime_t* tmout, void* wrctx, const mio_devaddr_t* dstaddr)
{
//return __dev_write(dev, data, len, tmout, wrctx, dstaddr);
return -1;
}
/* -------------------------------------------------------------------------- */
void mio_gettime (mio_t* mio, mio_ntime_t* now)

View File

@ -63,6 +63,13 @@ typedef struct mio_wq_t mio_wq_t;
typedef struct mio_cwq_t mio_cwq_t;
typedef mio_intptr_t mio_iolen_t; /* NOTE: this is a signed type */
struct mio_iovec_t
{
void* iov_ptr;
mio_oow_t iov_len;
};
typedef struct mio_iovec_t mio_iovec_t;
enum mio_errnum_t
{
MIO_ENOERR, /**< no error */
@ -807,6 +814,16 @@ MIO_EXPORT int mio_dev_timedwrite (
);
MIO_EXPORT int mio_dev_timedwritev (
mio_dev_t* dev,
const mio_iovec_t* iov,
mio_iolen_t iovcnt,
const mio_ntime_t* tmout,
void* wrctx,
const mio_devaddr_t* dstaddr
);
/* =========================================================================
* TIMER MANAGEMENT
* ========================================================================= */

View File

@ -1601,6 +1601,12 @@ int mio_dev_sck_timedwrite (mio_dev_sck_t* dev, const void* data, mio_iolen_t dl
return mio_dev_timedwrite((mio_dev_t*)dev, data, dlen, tmout, wrctx, skad_to_devaddr(dev, dstaddr, &devaddr));
}
int mio_dev_sck_timedwritev (mio_dev_sck_t* dev, const mio_iovec_t* iov, mio_iolen_t iovcnt, const mio_ntime_t* tmout, void* wrctx, const mio_skad_t* dstaddr)
{
mio_devaddr_t devaddr;
return mio_dev_timedwrite((mio_dev_t*)dev, iov, iovcnt, tmout, wrctx, skad_to_devaddr(dev, dstaddr, &devaddr));
}
/* ========================================================================= */