apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Turk" <mt...@mappingsoft.com>
Subject [WIN32] apr_sockets BUG?
Date Fri, 19 Apr 2002 06:36:21 GMT
Hi,

Dunno if I miss something, but the server/client test on WIN32 doesn't work.
Well, as far I've been able to track the things down the non-blocking
sockets are the bugger.

Server dump:

server: Initializing............................ OK
server: Creating context........................ OK
server: Preparing getopt........................ OK
server: Creating new socket..................... OK
server: Setting option APR_SO_NONBLOCK.......... OK
server: Setting option APR_SO_REUSEADDR......... OK
server: Binding socket to port.................. OK
server: Listening to socket..................... OK
server: Setting up for polling.................. OK
server: Polling for socket...................... OK
server: Accepting a connection.................. OK
Server socket: 127.0.0.1:8021 -> 127.0.0.1:3044
server: Receiving data from socket.............. Failed
Error (32535): apr_recv(sock2, datasend, &length)
A non-blocking socket operation could not be completed immediately.

Client dump:

Initializing.........OK
Creating context.......OK
        Client:  Making socket address...............OK
        Client:  Creating new socket.......OK
        Client:  Setting socket timeout.......OK
        Client:  Connecting to socket.......OK
        Client socket: 127.0.0.1:3044 -> 127.0.0.1:8021
        Client:  Trying to send data over socket.......OK
        Client:  Trying to receive data over socket.......Problem receiving
data
: An established connection was aborted by the software in your host
machine.
(32553)


Now, If I change the server code from:
    APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK",
        apr_setsocketopt(sock, APR_SO_NONBLOCK, 1))
to:
    APR_TEST_SUCCESS(rv, "Setting option APR_SO_NONBLOCK",
        apr_setsocketopt(sock, APR_TCP_NODELAY, 1))

everyting work fine :)

MT.


Mime
View raw message