|
@@ -27,7 +27,7 @@ int post_acceptex(hio_t* listenio, hoverlapped_t* hovlp) {
|
|
|
HV_ALLOC(hovlp->buf.buf, hovlp->buf.len);
|
|
HV_ALLOC(hovlp->buf.buf, hovlp->buf.len);
|
|
|
}
|
|
}
|
|
|
hovlp->fd = connfd;
|
|
hovlp->fd = connfd;
|
|
|
- hovlp->event = READ_EVENT;
|
|
|
|
|
|
|
+ hovlp->event = HV_READ;
|
|
|
hovlp->io = listenio;
|
|
hovlp->io = listenio;
|
|
|
if (AcceptEx(listenio->fd, connfd, hovlp->buf.buf, 0, sizeof(struct sockaddr_in6), sizeof(struct sockaddr_in6),
|
|
if (AcceptEx(listenio->fd, connfd, hovlp->buf.buf, 0, sizeof(struct sockaddr_in6), sizeof(struct sockaddr_in6),
|
|
|
&dwbytes, &hovlp->ovlp) != TRUE) {
|
|
&dwbytes, &hovlp->ovlp) != TRUE) {
|
|
@@ -45,7 +45,7 @@ int post_recv(hio_t* io, hoverlapped_t* hovlp) {
|
|
|
HV_ALLOC_SIZEOF(hovlp);
|
|
HV_ALLOC_SIZEOF(hovlp);
|
|
|
}
|
|
}
|
|
|
hovlp->fd = io->fd;
|
|
hovlp->fd = io->fd;
|
|
|
- hovlp->event = READ_EVENT;
|
|
|
|
|
|
|
+ hovlp->event = HV_READ;
|
|
|
hovlp->io = io;
|
|
hovlp->io = io;
|
|
|
if (io->readbuf.base == NULL || io->readbuf.len == 0) {
|
|
if (io->readbuf.base == NULL || io->readbuf.len == 0) {
|
|
|
hio_set_readbuf(io, io->loop->readbuf.base, io->loop->readbuf.len);
|
|
hio_set_readbuf(io, io->loop->readbuf.base, io->loop->readbuf.len);
|
|
@@ -216,7 +216,7 @@ end:
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void hio_handle_events(hio_t* io) {
|
|
static void hio_handle_events(hio_t* io) {
|
|
|
- if ((io->events & READ_EVENT) && (io->revents & READ_EVENT)) {
|
|
|
|
|
|
|
+ if ((io->events & HV_READ) && (io->revents & HV_READ)) {
|
|
|
if (io->accept) {
|
|
if (io->accept) {
|
|
|
on_acceptex_complete(io);
|
|
on_acceptex_complete(io);
|
|
|
}
|
|
}
|
|
@@ -247,7 +247,7 @@ int hio_accept (hio_t* io) {
|
|
|
for (int i = 0; i < ACCEPTEX_NUM; ++i) {
|
|
for (int i = 0; i < ACCEPTEX_NUM; ++i) {
|
|
|
post_acceptex(io, NULL);
|
|
post_acceptex(io, NULL);
|
|
|
}
|
|
}
|
|
|
- return hio_add(io, hio_handle_events, READ_EVENT);
|
|
|
|
|
|
|
+ return hio_add(io, hio_handle_events, HV_READ);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int hio_connect (hio_t* io) {
|
|
int hio_connect (hio_t* io) {
|
|
@@ -294,7 +294,7 @@ error:
|
|
|
|
|
|
|
|
int hio_read (hio_t* io) {
|
|
int hio_read (hio_t* io) {
|
|
|
post_recv(io, NULL);
|
|
post_recv(io, NULL);
|
|
|
- return hio_add(io, hio_handle_events, READ_EVENT);
|
|
|
|
|
|
|
+ return hio_add(io, hio_handle_events, HV_READ);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
int hio_write(hio_t* io, const void* buf, size_t len) {
|
|
int hio_write(hio_t* io, const void* buf, size_t len) {
|