apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vaclav Ovsik <Vaclav.Ov...@i.cz>
Subject apr_socket_accept() interrupted on Win32 corrupts master socket?
Date Mon, 03 Feb 2003 15:22:31 GMT
Hi,
I have written some very simple test server using apr (src included).

I met a problem on Windoze NT (among other things):
When the receive timeout occures on a call apr_socket_recv() in the
serving thread, a call to apr_socket_accept() is also interrupted in the
main thread. Next accept on the same socket ends on "socket operation on
non-socket".

The code output on Windoze NT4.0 (service pack 6) follows.
I simply ran the threadsock.exe and created one connection using the
netcat (from other host) and waited for timeout.

   apr_app_initialize(): done
   apr_pool_create(): done
   apr_socket_create(): done
   apr_sockaddr_info_get(): done
   apr_socket_bind(): done
   apr_socket_listen(): done
   apr_socket_accept(): done
   apr_thread_create(): done
   apr_socket_accept(): apr_thread_detach(): done
   apr_socket_timeout_set(): done
   apr_socket_send(): done
    - sent 13 bytes
   socket recv: apr_socket_recv() failed: Connection timed out
   failed: Interrupted system call
   apr_socket_accept(): failed: Socket operation on non-socket

String "failed: Interrupted system call" belongs to preceding
"apr_socket_accept():" of course. :-)

The listening master socket is probably away. This is apr or windoze
related behavior? (On Linux i386 this works like I expected.)

Is it possible to write simple server like this (performance doesn't
matter) without need a special code for Win32?

Excuse my English, please.
Thanks
-- 
Zito

Mime
View raw message