From e4b7baa885ca40a84f394acb075ba555e7b56d20 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Sat, 30 Jan 2010 00:35:05 +0100 Subject: [PATCH] Fix example/direct_tcpip.c to work also on WIN32 read() and write() are no good for WIN32 sockets, use recv() and send(). --- example/direct_tcpip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/direct_tcpip.c b/example/direct_tcpip.c index ebdde90a..6726db37 100644 --- a/example/direct_tcpip.c +++ b/example/direct_tcpip.c @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) goto shutdown; } if (rc && FD_ISSET(forwardsock, &fds)) { - len = read(forwardsock, buf, sizeof(buf)); + len = recv(forwardsock, buf, sizeof(buf), 0); if (len < 0) { perror("read"); goto shutdown; @@ -234,7 +234,7 @@ int main(int argc, char *argv[]) } wr = 0; while (wr < len) { - i = write(forwardsock, buf + wr, len - wr); + i = send(forwardsock, buf + wr, len - wr, 0); if (i <= 0) { perror("write"); goto shutdown;