src/os/win32/ngx_socket.c - nginx source code

Functions defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #include <ngx_config.h>
  6. #include <ngx_core.h>


  7. int
  8. ngx_nonblocking(ngx_socket_t s)
  9. {
  10.     unsigned long  nb = 1;

  11.     return ioctlsocket(s, FIONBIO, &nb);
  12. }


  13. int
  14. ngx_blocking(ngx_socket_t s)
  15. {
  16.     unsigned long  nb = 0;

  17.     return ioctlsocket(s, FIONBIO, &nb);
  18. }


  19. int
  20. ngx_socket_nread(ngx_socket_t s, int *n)
  21. {
  22.     unsigned long  nread;

  23.     if (ioctlsocket(s, FIONREAD, &nread) == -1) {
  24.         return -1;
  25.     }

  26.     *n = nread;

  27.     return 0;
  28. }


  29. int
  30. ngx_tcp_push(ngx_socket_t s)
  31. {
  32.     return 0;
  33. }