Commit 2d6be7ec authored by Pekka Pessi's avatar Pekka Pessi

Added SU_WAIT_CONNECT. Fixed su_vrecv() and su_vsend() on Win32.

darcs-hash:20051111173905-65a35-3cc987f197c7472cb4599fb58d8ea53b341a92c1.gz
parent 0cc3ab2f
......@@ -290,14 +290,14 @@ struct in_addr6 const *su_in6addr_loopback(void)
int su_vsend(su_socket_t s, su_iovec_t const iov[], int iovlen, int flags,
su_sockaddr_t const *su, socklen_t sulen)
{
DWORD bytes_sent = 0;
DWORD ret;
int ret;
DWORD bytes_sent = -1;
ret = WSASendTo(s,
(void *)iov,
(LPWSABUF)iov,
iovlen,
&bytes_sent,
0,
flags,
&su->su_sa,
sulen,
NULL,
......@@ -313,14 +313,15 @@ int su_vsend(su_socket_t s, su_iovec_t const iov[], int iovlen, int flags,
int su_vrecv(su_socket_t s, su_iovec_t iov[], int iovlen, int flags,
su_sockaddr_t *su, socklen_t *sulen)
{
DWORD bytes_recv = 0;
DWORD ret;
int ret;
DWORD bytes_recv = -1;
DWORD dflags = flags;
ret = WSARecvFrom(s,
(void *)iov,
(LPWSABUF)iov,
iovlen,
&bytes_recv,
0,
&dflags,
&su->su_sa,
sulen,
NULL,
......
......@@ -60,6 +60,8 @@
#define SU_WAIT_IN (POLLIN)
/** Data can be sent on socket. @HI */
#define SU_WAIT_OUT (POLLOUT)
/** Socket is connected. @HI */
#define SU_WAIT_CONNECT (POLLOUT)
/** An error occurred on socket. @HI */
#define SU_WAIT_ERR (POLLERR)
/** The socket connection was closed. @HI */
......@@ -81,6 +83,7 @@
#define SU_WAIT_IN (FD_READ)
#define SU_WAIT_OUT (FD_WRITE)
#define SU_WAIT_CONNECT (FD_CONNECT)
#define SU_WAIT_ERR (0) /* fuck this shit */
#define SU_WAIT_HUP (FD_CLOSE)
#define SU_WAIT_ACCEPT (FD_ACCEPT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment