Boost logo

Boost Users :

From: River Tarnell (river_at_[hidden])
Date: 2008-07-07 07:11:55


hi,

sorry for the vague question, but i'm not entirely sure what the problem here
is...

i have a class hierarchy (has-a relationship) like this:

  fcgi_server_connection
  +-fcgi_application
    +-fcgi_cgi

fcgi_server_connection has a tcp::socket 'server_socket'. fcgi_cgi has
another tcp::socket, 'child_socket'. the program asynchronously reads
messages from server_socket then writes them to child_socket, and reads messages
from child_socket then writes them to server_socket. (there is some
intermediate processing, but i don't think it affects the problem.)

the problem occurs when deleting these connections. firstly,
fcgi_server_connection is deleted. this deletes fcgi_application, which
deletes fcgi_cgi. the sockets are member objects, so they are deleted as part
of this.

the actual problem is this: sometimes, after a socket is deleted, instead of
oustanding read/write operations returning with asio::error::operation_aborted,
they return with no error (error==0), but with socket.native() equal to -1.

my understanding is that once the socket is deleted, all outstanding operations
should be cancelled and operation_aborted should be returned.

is this right? if so, what might cause the behaviour i'm seeing? and if not,
what am i missing?

thanks,
        - river.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net