The free function and client object are set into a property object which is
added to the message context.
//setting the property (inside http_sender)
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_FREE_FUNC(property, env,
axis2_http_client_free_void_arg); -> which inturn calls
axis2_http_client_free
AXIS2_PROPERTY_SET_VALUE(property, env, sender_impl->client);
AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_HTTP_CLIENT,
property, AXIS2_FALSE);
//after request is served this property get freed
103 if (property_impl->value)
(gdb)
105 if (property_impl->scope != AXIS2_SCOPE_APPLICATION)
(gdb)
107 if (property_impl->free_func)
(gdb)
109 property_impl->free_func(property_impl->value, env);
(gdb)
115 property_impl->value = NULL;
I suspect that it's an issue with closing the client socket in solaris.
AFAIK, the current implementation is not tested on Solaris systems.
-Nabeel
On 11/17/06, Beauchamp, Matthew <[EMAIL PROTECTED]> wrote:
In using the client API I'm seeing leaked file descriptors due to not
calling close on the sockets after their connections are finished. To
illustrate where I'm seeing this I'll describe my application. My service
has a "publish" operation (in-out MEP) that clients send commands to. The
response they get back is a status indicating the command was received
successfully. My service also creates a new thread when it is first
constructed that reads command responses off of a queue and uses the axis2c
client api to "publish" these responses back to clients. Everytime it takes
a response from the queue the thread allocates, sets options, does a
SEND_RECEIVE, FINALIZE_INVOKE, and frees the svc_client. After about 250
messages I get an "I/O Error: too many open files" from the system, and
checking the process's file descriptors shows many TCP sockets in a
CLOSE_WAIT state. By the way, I forgot to mention that I'm running on
solaris 8, which may of course be the problem. I'm wondering though if the
same thing happens under these conditions when running on Linux. In looking
through the code I see that the http_client is added to the msg_ctx in the
soap_over_http_sender, and there is a comment in the code saying it will be
free'd elsewhere. However, I am unable to locate where the http_client is
actually free'd, and print statements I placed in the axis2_http_client_free
function never show up in my runs. Any help anyone could provide would be
much appreciated.
Thanks,
Matt