Winsock fixes for shutdown()

This commit is contained in:
Jan Vidar Krey 2009-06-25 17:05:59 +02:00
parent 5b29a3b403
commit 9ebb38ae15
1 changed files with 12 additions and 0 deletions

View File

@ -265,17 +265,29 @@ int net_close(int fd)
int net_shutdown_r(int fd) int net_shutdown_r(int fd)
{ {
#ifdef WINSOCK
return shutdown(fd, SD_RECEIVE);
#else
return shutdown(fd, SHUT_RD); return shutdown(fd, SHUT_RD);
#endif
} }
int net_shutdown_w(int fd) int net_shutdown_w(int fd)
{ {
#ifdef WINSOCK
return shutdown(fd, SD_SEND)
#else
return shutdown(fd, SHUT_WR); return shutdown(fd, SHUT_WR);
#endif
} }
int net_shutdown_rw(int fd) int net_shutdown_rw(int fd)
{ {
#ifdef WINSOCK
return shutdown(fd, SD_BOTH);
#else
return shutdown(fd, SHUT_RDWR); return shutdown(fd, SHUT_RDWR);
#endif
} }
int net_accept(int fd, struct ip_addr_encap* ipaddr) int net_accept(int fd, struct ip_addr_encap* ipaddr)