[AGENT++] Socket file descriptor isn't closed

James McDonnell jmcdonnell at slipstream.com
Tue Sep 20 22:49:42 CEST 2005


Hi,

Any suggestions on how to completely shut-down the previous connection?

I'd actually like to be able to do this in situations where the master agent
hasn't actually disappeared but some other stimulus has occurred that
requires re-initializing the connection.

James

-----Original Message-----
From: agentpp-bounces at agentpp.org [mailto:agentpp-bounces at agentpp.org] On
Behalf Of James McDonnell
Sent: September 15, 2005 4:45 PM
To: agentpp at agentpp.org
Subject: [AGENT++] Socket file descriptor isn't closed

Hi,

I've created a sub-agent using AgentX 1.4.12c with the code setup to
re-establish the connection as recommended on page 26 of
http://www.agentpp.com/agentX++/AgentX++1.4.8.pdf.  This code seems to have
a problem though in that it doesn't do a close on the file descriptor for
the previous connection.  So even though that connection is terminated the
file descriptor remains in use in the sub-agent.  Is there some way to fully
shut down the previous connection?

I also had another problem which you might wish to know about.  I'm using
the code on a FreeBSD system and I found that the connect call in
AgentXSlave::bind_tcp failed when compiled with SNMP_PP_IPv6 defined.  The
connect function didn't seem to like the fact that sizeof(sockaddr_storage)
was passed as the third parameter.  I changed my copy of the code to pass
sizeof(sockaddr_in) or sizeof(sockaddr_in6) as appropriate.

Thanks,
James McDonnell

_______________________________________________
AGENTPP mailing list
AGENTPP at agentpp.org
http://lists.agentpp.org/mailman/listinfo/agentpp




More information about the AGENTPP mailing list